3 #define PY_SSIZE_T_CLEAN
6 #error Python headers needed to compile C extensions, please install development version of Python.
7 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
8 #error Cython requires Python 2.6+ or Python 3.3+.
10 #define CYTHON_ABI "0_29_21"
11 #define CYTHON_HEX_VERSION 0x001D15F0
12 #define CYTHON_FUTURE_DIVISION 0
15 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
17 #if !defined(WIN32) && !defined(MS_WINDOWS)
29 #define DL_IMPORT(t) t
32 #define DL_EXPORT(t) t
35 #ifndef HAVE_LONG_LONG
36 #if PY_VERSION_HEX >= 0x02070000
37 #define HAVE_LONG_LONG
41 #define PY_LONG_LONG LONG_LONG
44 #define Py_HUGE_VAL HUGE_VAL
47 #define CYTHON_COMPILING_IN_PYPY 1
48 #define CYTHON_COMPILING_IN_PYSTON 0
49 #define CYTHON_COMPILING_IN_CPYTHON 0
50 #undef CYTHON_USE_TYPE_SLOTS
51 #define CYTHON_USE_TYPE_SLOTS 0
52 #undef CYTHON_USE_PYTYPE_LOOKUP
53 #define CYTHON_USE_PYTYPE_LOOKUP 0
54 #if PY_VERSION_HEX < 0x03050000
55 #undef CYTHON_USE_ASYNC_SLOTS
56 #define CYTHON_USE_ASYNC_SLOTS 0
57 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
58 #define CYTHON_USE_ASYNC_SLOTS 1
60 #undef CYTHON_USE_PYLIST_INTERNALS
61 #define CYTHON_USE_PYLIST_INTERNALS 0
62 #undef CYTHON_USE_UNICODE_INTERNALS
63 #define CYTHON_USE_UNICODE_INTERNALS 0
64 #undef CYTHON_USE_UNICODE_WRITER
65 #define CYTHON_USE_UNICODE_WRITER 0
66 #undef CYTHON_USE_PYLONG_INTERNALS
67 #define CYTHON_USE_PYLONG_INTERNALS 0
68 #undef CYTHON_AVOID_BORROWED_REFS
69 #define CYTHON_AVOID_BORROWED_REFS 1
70 #undef CYTHON_ASSUME_SAFE_MACROS
71 #define CYTHON_ASSUME_SAFE_MACROS 0
72 #undef CYTHON_UNPACK_METHODS
73 #define CYTHON_UNPACK_METHODS 0
74 #undef CYTHON_FAST_THREAD_STATE
75 #define CYTHON_FAST_THREAD_STATE 0
76 #undef CYTHON_FAST_PYCALL
77 #define CYTHON_FAST_PYCALL 0
78 #undef CYTHON_PEP489_MULTI_PHASE_INIT
79 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
80 #undef CYTHON_USE_TP_FINALIZE
81 #define CYTHON_USE_TP_FINALIZE 0
82 #undef CYTHON_USE_DICT_VERSIONS
83 #define CYTHON_USE_DICT_VERSIONS 0
84 #undef CYTHON_USE_EXC_INFO_STACK
85 #define CYTHON_USE_EXC_INFO_STACK 0
86 #elif defined(PYSTON_VERSION)
87 #define CYTHON_COMPILING_IN_PYPY 0
88 #define CYTHON_COMPILING_IN_PYSTON 1
89 #define CYTHON_COMPILING_IN_CPYTHON 0
90 #ifndef CYTHON_USE_TYPE_SLOTS
91 #define CYTHON_USE_TYPE_SLOTS 1
93 #undef CYTHON_USE_PYTYPE_LOOKUP
94 #define CYTHON_USE_PYTYPE_LOOKUP 0
95 #undef CYTHON_USE_ASYNC_SLOTS
96 #define CYTHON_USE_ASYNC_SLOTS 0
97 #undef CYTHON_USE_PYLIST_INTERNALS
98 #define CYTHON_USE_PYLIST_INTERNALS 0
99 #ifndef CYTHON_USE_UNICODE_INTERNALS
100 #define CYTHON_USE_UNICODE_INTERNALS 1
102 #undef CYTHON_USE_UNICODE_WRITER
103 #define CYTHON_USE_UNICODE_WRITER 0
104 #undef CYTHON_USE_PYLONG_INTERNALS
105 #define CYTHON_USE_PYLONG_INTERNALS 0
106 #ifndef CYTHON_AVOID_BORROWED_REFS
107 #define CYTHON_AVOID_BORROWED_REFS 0
109 #ifndef CYTHON_ASSUME_SAFE_MACROS
110 #define CYTHON_ASSUME_SAFE_MACROS 1
112 #ifndef CYTHON_UNPACK_METHODS
113 #define CYTHON_UNPACK_METHODS 1
115 #undef CYTHON_FAST_THREAD_STATE
116 #define CYTHON_FAST_THREAD_STATE 0
117 #undef CYTHON_FAST_PYCALL
118 #define CYTHON_FAST_PYCALL 0
119 #undef CYTHON_PEP489_MULTI_PHASE_INIT
120 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
121 #undef CYTHON_USE_TP_FINALIZE
122 #define CYTHON_USE_TP_FINALIZE 0
123 #undef CYTHON_USE_DICT_VERSIONS
124 #define CYTHON_USE_DICT_VERSIONS 0
125 #undef CYTHON_USE_EXC_INFO_STACK
126 #define CYTHON_USE_EXC_INFO_STACK 0
128 #define CYTHON_COMPILING_IN_PYPY 0
129 #define CYTHON_COMPILING_IN_PYSTON 0
130 #define CYTHON_COMPILING_IN_CPYTHON 1
131 #ifndef CYTHON_USE_TYPE_SLOTS
132 #define CYTHON_USE_TYPE_SLOTS 1
134 #if PY_VERSION_HEX < 0x02070000
135 #undef CYTHON_USE_PYTYPE_LOOKUP
136 #define CYTHON_USE_PYTYPE_LOOKUP 0
137 #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
138 #define CYTHON_USE_PYTYPE_LOOKUP 1
140 #if PY_MAJOR_VERSION < 3
141 #undef CYTHON_USE_ASYNC_SLOTS
142 #define CYTHON_USE_ASYNC_SLOTS 0
143 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
144 #define CYTHON_USE_ASYNC_SLOTS 1
146 #if PY_VERSION_HEX < 0x02070000
147 #undef CYTHON_USE_PYLONG_INTERNALS
148 #define CYTHON_USE_PYLONG_INTERNALS 0
149 #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
150 #define CYTHON_USE_PYLONG_INTERNALS 1
152 #ifndef CYTHON_USE_PYLIST_INTERNALS
153 #define CYTHON_USE_PYLIST_INTERNALS 1
155 #ifndef CYTHON_USE_UNICODE_INTERNALS
156 #define CYTHON_USE_UNICODE_INTERNALS 1
158 #if PY_VERSION_HEX < 0x030300F0
159 #undef CYTHON_USE_UNICODE_WRITER
160 #define CYTHON_USE_UNICODE_WRITER 0
161 #elif !defined(CYTHON_USE_UNICODE_WRITER)
162 #define CYTHON_USE_UNICODE_WRITER 1
164 #ifndef CYTHON_AVOID_BORROWED_REFS
165 #define CYTHON_AVOID_BORROWED_REFS 0
167 #ifndef CYTHON_ASSUME_SAFE_MACROS
168 #define CYTHON_ASSUME_SAFE_MACROS 1
170 #ifndef CYTHON_UNPACK_METHODS
171 #define CYTHON_UNPACK_METHODS 1
173 #ifndef CYTHON_FAST_THREAD_STATE
174 #define CYTHON_FAST_THREAD_STATE 1
176 #ifndef CYTHON_FAST_PYCALL
177 #define CYTHON_FAST_PYCALL 1
179 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
180 #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
182 #ifndef CYTHON_USE_TP_FINALIZE
183 #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
185 #ifndef CYTHON_USE_DICT_VERSIONS
186 #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1)
188 #ifndef CYTHON_USE_EXC_INFO_STACK
189 #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
192 #if !defined(CYTHON_FAST_PYCCALL)
193 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
195 #if CYTHON_USE_PYLONG_INTERNALS
196 #include "longintrepr.h"
201 enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P ==
sizeof(
void*)) };
204 #ifndef __has_attribute
205 #define __has_attribute(x) 0
207 #ifndef __has_cpp_attribute
208 #define __has_cpp_attribute(x) 0
210 #ifndef CYTHON_RESTRICT
211 #if defined(__GNUC__)
212 #define CYTHON_RESTRICT __restrict__
213 #elif defined(_MSC_VER) && _MSC_VER >= 1400
214 #define CYTHON_RESTRICT __restrict
215 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
216 #define CYTHON_RESTRICT restrict
218 #define CYTHON_RESTRICT
221 #ifndef CYTHON_UNUSED
222 # if defined(__GNUC__)
223 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
224 # define CYTHON_UNUSED __attribute__ ((__unused__))
226 # define CYTHON_UNUSED
228 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
229 # define CYTHON_UNUSED __attribute__ ((__unused__))
231 # define CYTHON_UNUSED
234 #ifndef CYTHON_MAYBE_UNUSED_VAR
235 # if defined(__cplusplus)
236 template<
class T>
void CYTHON_MAYBE_UNUSED_VAR(
const T& ) { }
238 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
241 #ifndef CYTHON_NCP_UNUSED
242 # if CYTHON_COMPILING_IN_CPYTHON
243 # define CYTHON_NCP_UNUSED
245 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
248 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
250 #ifndef _MSC_STDINT_H_
252 typedef unsigned char uint8_t;
253 typedef unsigned int uint32_t;
255 typedef unsigned __int8 uint8_t;
256 typedef unsigned __int32 uint32_t;
262 #ifndef CYTHON_FALLTHROUGH
263 #if defined(__cplusplus) && __cplusplus >= 201103L
264 #if __has_cpp_attribute(fallthrough)
265 #define CYTHON_FALLTHROUGH [[fallthrough]]
266 #elif __has_cpp_attribute(clang::fallthrough)
267 #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
268 #elif __has_cpp_attribute(gnu::fallthrough)
269 #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
272 #ifndef CYTHON_FALLTHROUGH
273 #if __has_attribute(fallthrough)
274 #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
276 #define CYTHON_FALLTHROUGH
279 #if defined(__clang__ ) && defined(__apple_build_version__)
280 #if __apple_build_version__ < 7000000
281 #undef CYTHON_FALLTHROUGH
282 #define CYTHON_FALLTHROUGH
287 #ifndef CYTHON_INLINE
288 #if defined(__clang__)
289 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
290 #elif defined(__GNUC__)
291 #define CYTHON_INLINE __inline__
292 #elif defined(_MSC_VER)
293 #define CYTHON_INLINE __inline
294 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
295 #define CYTHON_INLINE inline
297 #define CYTHON_INLINE
301 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
302 #define Py_OptimizeFlag 0
304 #define __PYX_BUILD_PY_SSIZE_T "n"
305 #define CYTHON_FORMAT_SSIZE_T "z"
306 #if PY_MAJOR_VERSION < 3
307 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
308 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
309 PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
310 #define __Pyx_DefaultClassType PyClass_Type
312 #define __Pyx_BUILTIN_MODULE_NAME "builtins"
313 #if PY_VERSION_HEX >= 0x030800A4 && PY_VERSION_HEX < 0x030800B2
314 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
315 PyCode_New(a, 0, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
317 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
318 PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
320 #define __Pyx_DefaultClassType PyType_Type
322 #ifndef Py_TPFLAGS_CHECKTYPES
323 #define Py_TPFLAGS_CHECKTYPES 0
325 #ifndef Py_TPFLAGS_HAVE_INDEX
326 #define Py_TPFLAGS_HAVE_INDEX 0
328 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
329 #define Py_TPFLAGS_HAVE_NEWBUFFER 0
331 #ifndef Py_TPFLAGS_HAVE_FINALIZE
332 #define Py_TPFLAGS_HAVE_FINALIZE 0
334 #ifndef METH_STACKLESS
335 #define METH_STACKLESS 0
337 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
338 #ifndef METH_FASTCALL
339 #define METH_FASTCALL 0x80
341 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *
self, PyObject *
const *args, Py_ssize_t nargs);
342 typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *
self, PyObject *
const *args,
343 Py_ssize_t nargs, PyObject *kwnames);
345 #define __Pyx_PyCFunctionFast _PyCFunctionFast
346 #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
348 #if CYTHON_FAST_PYCCALL
349 #define __Pyx_PyFastCFunction_Check(func)\
350 ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
352 #define __Pyx_PyFastCFunction_Check(func) 0
354 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
355 #define PyObject_Malloc(s) PyMem_Malloc(s)
356 #define PyObject_Free(p) PyMem_Free(p)
357 #define PyObject_Realloc(p) PyMem_Realloc(p)
359 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
360 #define PyMem_RawMalloc(n) PyMem_Malloc(n)
361 #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n)
362 #define PyMem_RawFree(p) PyMem_Free(p)
364 #if CYTHON_COMPILING_IN_PYSTON
365 #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
366 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
368 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
369 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
371 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
372 #define __Pyx_PyThreadState_Current PyThreadState_GET()
373 #elif PY_VERSION_HEX >= 0x03060000
374 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
375 #elif PY_VERSION_HEX >= 0x03000000
376 #define __Pyx_PyThreadState_Current PyThreadState_GET()
378 #define __Pyx_PyThreadState_Current _PyThreadState_Current
380 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
381 #include "pythread.h"
382 #define Py_tss_NEEDS_INIT 0
383 typedef int Py_tss_t;
384 static CYTHON_INLINE
int PyThread_tss_create(Py_tss_t *key) {
385 *key = PyThread_create_key();
388 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(
void) {
389 Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(
sizeof(Py_tss_t));
390 *key = Py_tss_NEEDS_INIT;
393 static CYTHON_INLINE
void PyThread_tss_free(Py_tss_t *key) {
396 static CYTHON_INLINE
int PyThread_tss_is_created(Py_tss_t *key) {
397 return *key != Py_tss_NEEDS_INIT;
399 static CYTHON_INLINE
void PyThread_tss_delete(Py_tss_t *key) {
400 PyThread_delete_key(*key);
401 *key = Py_tss_NEEDS_INIT;
403 static CYTHON_INLINE
int PyThread_tss_set(Py_tss_t *key,
void *value) {
404 return PyThread_set_key_value(*key, value);
406 static CYTHON_INLINE
void * PyThread_tss_get(Py_tss_t *key) {
407 return PyThread_get_key_value(*key);
410 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
411 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
413 #define __Pyx_PyDict_NewPresized(n) PyDict_New()
415 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
416 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
417 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
419 #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
420 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
422 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
423 #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
425 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
427 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
428 #define CYTHON_PEP393_ENABLED 1
429 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
430 0 : _PyUnicode_Ready((PyObject *)(op)))
431 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
432 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
433 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
434 #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
435 #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
436 #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
437 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)
438 #if defined(PyUnicode_IS_READY) && defined(PyUnicode_GET_SIZE)
439 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
441 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u))
444 #define CYTHON_PEP393_ENABLED 0
445 #define PyUnicode_1BYTE_KIND 1
446 #define PyUnicode_2BYTE_KIND 2
447 #define PyUnicode_4BYTE_KIND 4
448 #define __Pyx_PyUnicode_READY(op) (0)
449 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
450 #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
451 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
452 #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
453 #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
454 #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
455 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
456 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
458 #if CYTHON_COMPILING_IN_PYPY
459 #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
460 #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
462 #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
463 #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
464 PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
466 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
467 #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
469 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
470 #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
472 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
473 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
475 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
476 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
477 #if PY_MAJOR_VERSION >= 3
478 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
480 #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
482 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
483 #define PyObject_ASCII(o) PyObject_Repr(o)
485 #if PY_MAJOR_VERSION >= 3
486 #define PyBaseString_Type PyUnicode_Type
487 #define PyStringObject PyUnicodeObject
488 #define PyString_Type PyUnicode_Type
489 #define PyString_Check PyUnicode_Check
490 #define PyString_CheckExact PyUnicode_CheckExact
491 #ifndef PyObject_Unicode
492 #define PyObject_Unicode PyObject_Str
495 #if PY_MAJOR_VERSION >= 3
496 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
497 #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
499 #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
500 #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
502 #ifndef PySet_CheckExact
503 #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
505 #if PY_VERSION_HEX >= 0x030900A4
506 #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
507 #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
509 #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
510 #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
512 #if CYTHON_ASSUME_SAFE_MACROS
513 #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
515 #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
517 #if PY_MAJOR_VERSION >= 3
518 #define PyIntObject PyLongObject
519 #define PyInt_Type PyLong_Type
520 #define PyInt_Check(op) PyLong_Check(op)
521 #define PyInt_CheckExact(op) PyLong_CheckExact(op)
522 #define PyInt_FromString PyLong_FromString
523 #define PyInt_FromUnicode PyLong_FromUnicode
524 #define PyInt_FromLong PyLong_FromLong
525 #define PyInt_FromSize_t PyLong_FromSize_t
526 #define PyInt_FromSsize_t PyLong_FromSsize_t
527 #define PyInt_AsLong PyLong_AsLong
528 #define PyInt_AS_LONG PyLong_AS_LONG
529 #define PyInt_AsSsize_t PyLong_AsSsize_t
530 #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
531 #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
532 #define PyNumber_Int PyNumber_Long
534 #if PY_MAJOR_VERSION >= 3
535 #define PyBoolObject PyLongObject
537 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
538 #ifndef PyUnicode_InternFromString
539 #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
542 #if PY_VERSION_HEX < 0x030200A4
543 typedef long Py_hash_t;
544 #define __Pyx_PyInt_FromHash_t PyInt_FromLong
545 #define __Pyx_PyInt_AsHash_t PyInt_AsLong
547 #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
548 #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
550 #if PY_MAJOR_VERSION >= 3
551 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? ((void)(klass), PyMethod_New(func, self)) : __Pyx_NewRef(func))
553 #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
555 #if CYTHON_USE_ASYNC_SLOTS
556 #if PY_VERSION_HEX >= 0x030500B1
557 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
558 #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
560 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
563 #define __Pyx_PyType_AsAsync(obj) NULL
565 #ifndef __Pyx_PyAsyncMethodsStruct
570 } __Pyx_PyAsyncMethodsStruct;
573 #if defined(WIN32) || defined(MS_WINDOWS)
574 #define _USE_MATH_DEFINES
578 #define __PYX_NAN() ((float) NAN)
580 static CYTHON_INLINE
float __PYX_NAN() {
582 memset(&value, 0xFF,
sizeof(value));
586 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
587 #define __Pyx_truncl trunc
589 #define __Pyx_truncl truncl
592 #define __PYX_MARK_ERR_POS(f_index, lineno) \
593 { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }
594 #define __PYX_ERR(f_index, lineno, Ln_error) \
595 { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
597 #ifndef __PYX_EXTERN_C
599 #define __PYX_EXTERN_C extern "C"
601 #define __PYX_EXTERN_C extern
605 #define __PYX_HAVE__csmoothers
606 #define __PYX_HAVE_API__csmoothers
610 #include "numpy/arrayobject.h"
611 #include "numpy/ufuncobject.h"
617 #include "pythread.h"
624 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
625 #define CYTHON_WITHOUT_ASSERTIONS
628 typedef struct {PyObject **p;
const char *
s;
const Py_ssize_t
n;
const char* encoding;
629 const char is_unicode;
const char is_str;
const char intern; } __Pyx_StringTabEntry;
631 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
632 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
633 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
634 #define __PYX_DEFAULT_STRING_ENCODING ""
635 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
636 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
637 #define __Pyx_uchar_cast(c) ((unsigned char)c)
638 #define __Pyx_long_cast(x) ((long)x)
639 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
640 (sizeof(type) < sizeof(Py_ssize_t)) ||\
641 (sizeof(type) > sizeof(Py_ssize_t) &&\
642 likely(v < (type)PY_SSIZE_T_MAX ||\
643 v == (type)PY_SSIZE_T_MAX) &&\
644 (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
645 v == (type)PY_SSIZE_T_MIN))) ||\
646 (sizeof(type) == sizeof(Py_ssize_t) &&\
647 (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
648 v == (type)PY_SSIZE_T_MAX))) )
649 static CYTHON_INLINE
int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
650 return (
size_t) i < (size_t) limit;
652 #if defined (__cplusplus) && __cplusplus >= 201103L
654 #define __Pyx_sst_abs(value) std::abs(value)
655 #elif SIZEOF_INT >= SIZEOF_SIZE_T
656 #define __Pyx_sst_abs(value) abs(value)
657 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
658 #define __Pyx_sst_abs(value) labs(value)
659 #elif defined (_MSC_VER)
660 #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
661 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
662 #define __Pyx_sst_abs(value) llabs(value)
663 #elif defined (__GNUC__)
664 #define __Pyx_sst_abs(value) __builtin_llabs(value)
666 #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
668 static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject*);
669 static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
670 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
671 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
672 #define __Pyx_PyBytes_FromString PyBytes_FromString
673 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
674 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char*);
675 #if PY_MAJOR_VERSION < 3
676 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
677 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
679 #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
680 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
682 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
683 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
684 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
685 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
686 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
687 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
688 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
689 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
690 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
691 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
692 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
693 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
694 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
695 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
696 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
697 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
698 static CYTHON_INLINE
size_t __Pyx_Py_UNICODE_strlen(
const Py_UNICODE *
u) {
699 const Py_UNICODE *u_end =
u;
701 return (
size_t)(u_end -
u - 1);
703 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
704 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
705 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
706 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
707 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
708 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(
long b);
709 static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject*);
710 static CYTHON_INLINE
int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
711 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
712 #define __Pyx_PySequence_Tuple(obj)\
713 (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
714 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
715 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(
size_t);
716 #if CYTHON_ASSUME_SAFE_MACROS
717 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
719 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
721 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
722 #if PY_MAJOR_VERSION >= 3
723 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
725 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
727 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
728 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
729 static int __Pyx_sys_getdefaultencoding_not_ascii;
730 static int __Pyx_init_sys_getdefaultencoding_params(
void) {
732 PyObject* default_encoding = NULL;
733 PyObject* ascii_chars_u = NULL;
734 PyObject* ascii_chars_b = NULL;
735 const char* default_encoding_c;
736 sys = PyImport_ImportModule(
"sys");
738 default_encoding = PyObject_CallMethod(sys, (
char*)
"getdefaultencoding", NULL);
740 if (!default_encoding)
goto bad;
741 default_encoding_c = PyBytes_AsString(default_encoding);
742 if (!default_encoding_c)
goto bad;
743 if (strcmp(default_encoding_c,
"ascii") == 0) {
744 __Pyx_sys_getdefaultencoding_not_ascii = 0;
746 char ascii_chars[128];
748 for (
c = 0;
c < 128;
c++) {
751 __Pyx_sys_getdefaultencoding_not_ascii = 1;
752 ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
753 if (!ascii_chars_u)
goto bad;
754 ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
755 if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
758 "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
762 Py_DECREF(ascii_chars_u);
763 Py_DECREF(ascii_chars_b);
765 Py_DECREF(default_encoding);
768 Py_XDECREF(default_encoding);
769 Py_XDECREF(ascii_chars_u);
770 Py_XDECREF(ascii_chars_b);
774 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
775 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
777 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
778 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
779 static char* __PYX_DEFAULT_STRING_ENCODING;
780 static int __Pyx_init_sys_getdefaultencoding_params(
void) {
782 PyObject* default_encoding = NULL;
783 char* default_encoding_c;
784 sys = PyImport_ImportModule(
"sys");
786 default_encoding = PyObject_CallMethod(sys, (
char*) (
const char*)
"getdefaultencoding", NULL);
788 if (!default_encoding)
goto bad;
789 default_encoding_c = PyBytes_AsString(default_encoding);
790 if (!default_encoding_c)
goto bad;
791 __PYX_DEFAULT_STRING_ENCODING = (
char*) malloc(strlen(default_encoding_c) + 1);
792 if (!__PYX_DEFAULT_STRING_ENCODING)
goto bad;
793 strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
794 Py_DECREF(default_encoding);
797 Py_XDECREF(default_encoding);
805 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
806 #define likely(x) __builtin_expect(!!(x), 1)
807 #define unlikely(x) __builtin_expect(!!(x), 0)
809 #define likely(x) (x)
810 #define unlikely(x) (x)
812 static CYTHON_INLINE
void __Pyx_pretend_to_initialize(
void* ptr) { (void)ptr; }
814 static PyObject *__pyx_m = NULL;
815 static PyObject *__pyx_d;
816 static PyObject *__pyx_b;
817 static PyObject *__pyx_cython_runtime = NULL;
818 static PyObject *__pyx_empty_tuple;
819 static PyObject *__pyx_empty_bytes;
820 static PyObject *__pyx_empty_unicode;
821 static int __pyx_lineno;
822 static int __pyx_clineno = 0;
823 static const char * __pyx_cfilenm= __FILE__;
824 static const char *__pyx_filename;
827 #if !defined(CYTHON_CCOMPLEX)
828 #if defined(__cplusplus)
829 #define CYTHON_CCOMPLEX 1
830 #elif defined(_Complex_I)
831 #define CYTHON_CCOMPLEX 1
833 #define CYTHON_CCOMPLEX 0
843 #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
845 #define _Complex_I 1.0fj
849 static const char *__pyx_f[] = {
850 "proteus/csmoothers.pyx",
854 "proteus/superluWrappers.pxd",
857 struct __pyx_memoryview_obj;
859 struct __pyx_memoryview_obj *memview;
862 Py_ssize_t strides[8];
863 Py_ssize_t suboffsets[8];
864 } __Pyx_memviewslice;
865 #define __Pyx_MemoryView_Len(m) (m.shape[0])
868 #include <pythread.h>
869 #ifndef CYTHON_ATOMICS
870 #define CYTHON_ATOMICS 1
872 #define __pyx_atomic_int_type int
873 #if CYTHON_ATOMICS && __GNUC__ >= 4 && (__GNUC_MINOR__ > 1 ||\
874 (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL >= 2)) &&\
876 #define __pyx_atomic_incr_aligned(value, lock) __sync_fetch_and_add(value, 1)
877 #define __pyx_atomic_decr_aligned(value, lock) __sync_fetch_and_sub(value, 1)
878 #ifdef __PYX_DEBUG_ATOMICS
879 #warning "Using GNU atomics"
881 #elif CYTHON_ATOMICS && defined(_MSC_VER) && 0
883 #undef __pyx_atomic_int_type
884 #define __pyx_atomic_int_type LONG
885 #define __pyx_atomic_incr_aligned(value, lock) InterlockedIncrement(value)
886 #define __pyx_atomic_decr_aligned(value, lock) InterlockedDecrement(value)
887 #ifdef __PYX_DEBUG_ATOMICS
888 #pragma message ("Using MSVC atomics")
890 #elif CYTHON_ATOMICS && (defined(__ICC) || defined(__INTEL_COMPILER)) && 0
891 #define __pyx_atomic_incr_aligned(value, lock) _InterlockedIncrement(value)
892 #define __pyx_atomic_decr_aligned(value, lock) _InterlockedDecrement(value)
893 #ifdef __PYX_DEBUG_ATOMICS
894 #warning "Using Intel atomics"
897 #undef CYTHON_ATOMICS
898 #define CYTHON_ATOMICS 0
899 #ifdef __PYX_DEBUG_ATOMICS
900 #warning "Not using atomics"
903 typedef volatile __pyx_atomic_int_type __pyx_atomic_int;
905 #define __pyx_add_acquisition_count(memview)\
906 __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
907 #define __pyx_sub_acquisition_count(memview)\
908 __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
910 #define __pyx_add_acquisition_count(memview)\
911 __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
912 #define __pyx_sub_acquisition_count(memview)\
913 __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
917 #ifndef __PYX_FORCE_INIT_THREADS
918 #define __PYX_FORCE_INIT_THREADS 0
922 #define __Pyx_PyGILState_Ensure PyGILState_Ensure
923 #define __Pyx_PyGILState_Release PyGILState_Release
924 #define __Pyx_FastGIL_Remember()
925 #define __Pyx_FastGIL_Forget()
926 #define __Pyx_FastGilFuncInit()
929 #define IS_UNSIGNED(type) (((type) -1) > 0)
930 struct __Pyx_StructField_;
931 #define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
934 struct __Pyx_StructField_* fields;
942 typedef struct __Pyx_StructField_ {
943 __Pyx_TypeInfo* type;
948 __Pyx_StructField* field;
949 size_t parent_offset;
950 } __Pyx_BufFmt_StackElem;
952 __Pyx_StructField root;
953 __Pyx_BufFmt_StackElem* head;
955 size_t new_count, enc_count;
956 size_t struct_alignment;
962 } __Pyx_BufFmt_Context;
972 typedef npy_int8 __pyx_t_5numpy_int8_t;
981 typedef npy_int16 __pyx_t_5numpy_int16_t;
990 typedef npy_int32 __pyx_t_5numpy_int32_t;
999 typedef npy_int64 __pyx_t_5numpy_int64_t;
1008 typedef npy_uint8 __pyx_t_5numpy_uint8_t;
1017 typedef npy_uint16 __pyx_t_5numpy_uint16_t;
1026 typedef npy_uint32 __pyx_t_5numpy_uint32_t;
1035 typedef npy_uint64 __pyx_t_5numpy_uint64_t;
1044 typedef npy_float32 __pyx_t_5numpy_float32_t;
1053 typedef npy_float64 __pyx_t_5numpy_float64_t;
1062 typedef npy_long __pyx_t_5numpy_int_t;
1071 typedef npy_longlong __pyx_t_5numpy_long_t;
1080 typedef npy_longlong __pyx_t_5numpy_longlong_t;
1089 typedef npy_ulong __pyx_t_5numpy_uint_t;
1098 typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
1107 typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1116 typedef npy_intp __pyx_t_5numpy_intp_t;
1125 typedef npy_uintp __pyx_t_5numpy_uintp_t;
1134 typedef npy_double __pyx_t_5numpy_float_t;
1143 typedef npy_double __pyx_t_5numpy_double_t;
1152 typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
1161 typedef int __pyx_t_10csmoothers_PROTEUS_LAPACK_INTEGER;
1165 typedef ::std::complex< float > __pyx_t_float_complex;
1167 typedef float _Complex __pyx_t_float_complex;
1170 typedef struct {
float real, imag; } __pyx_t_float_complex;
1172 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float,
float);
1177 typedef ::std::complex< double > __pyx_t_double_complex;
1179 typedef double _Complex __pyx_t_double_complex;
1182 typedef struct {
double real, imag; } __pyx_t_double_complex;
1184 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double,
double);
1188 struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix;
1189 struct __pyx_obj_10csmoothers_cASMFactor;
1190 struct __pyx_obj_10csmoothers_cBASMFactor;
1191 struct __pyx_array_obj;
1192 struct __pyx_MemviewEnum_obj;
1193 struct __pyx_memoryview_obj;
1194 struct __pyx_memoryviewslice_obj;
1203 typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
1212 typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
1221 typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
1230 typedef npy_cdouble __pyx_t_5numpy_complex_t;
1231 struct __pyx_t_7proteus_15superluWrappers__NRformat;
1240 struct __pyx_t_7proteus_15superluWrappers__NRformat {
1241 __pyx_t_5numpy_int32_t
nnz;
1242 __pyx_t_5numpy_float64_t *nzval;
1243 __pyx_t_5numpy_int32_t *colind;
1244 __pyx_t_5numpy_int32_t *rowptr;
1254 typedef __Pyx_memviewslice __pyx_t_10csmoothers_DDATA;
1263 typedef __Pyx_memviewslice __pyx_t_10csmoothers_IDATA;
1272 typedef SuperMatrix __pyx_t_10csmoothers_SuperMatrix;
1281 struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix {
1283 __pyx_t_5numpy_int32_t dim[2];
1284 struct __pyx_t_7proteus_15superluWrappers__NRformat A;
1295 struct __pyx_obj_10csmoothers_cASMFactor {
1300 double **subdomain_L;
1301 double **subdomain_R;
1302 double **subdomain_dX;
1303 __pyx_t_10csmoothers_PROTEUS_LAPACK_INTEGER **subdomain_pivots;
1314 struct __pyx_obj_10csmoothers_cBASMFactor {
1320 double **subdomain_L;
1321 double **subdomain_R;
1322 double **subdomain_dX;
1323 __pyx_t_10csmoothers_PROTEUS_LAPACK_INTEGER **subdomain_pivots;
1324 __pyx_t_10csmoothers_PROTEUS_LAPACK_INTEGER **subdomain_col_pivots;
1335 struct __pyx_array_obj {
1337 struct __pyx_vtabstruct_array *__pyx_vtab;
1343 Py_ssize_t *_strides;
1344 Py_ssize_t itemsize;
1347 void (*callback_free_data)(
void *);
1349 int dtype_is_object;
1360 struct __pyx_MemviewEnum_obj {
1373 struct __pyx_memoryview_obj {
1375 struct __pyx_vtabstruct_memoryview *__pyx_vtab;
1378 PyObject *_array_interface;
1379 PyThread_type_lock lock;
1380 __pyx_atomic_int acquisition_count[2];
1381 __pyx_atomic_int *acquisition_count_aligned_p;
1384 int dtype_is_object;
1385 __Pyx_TypeInfo *typeinfo;
1396 struct __pyx_memoryviewslice_obj {
1397 struct __pyx_memoryview_obj __pyx_base;
1398 __Pyx_memviewslice from_slice;
1399 PyObject *from_object;
1400 PyObject *(*to_object_func)(
char *);
1401 int (*to_dtype_func)(
char *, PyObject *);
1414 struct __pyx_vtabstruct_array {
1415 PyObject *(*get_memview)(
struct __pyx_array_obj *);
1417 static struct __pyx_vtabstruct_array *__pyx_vtabptr_array;
1428 struct __pyx_vtabstruct_memoryview {
1429 char *(*get_item_pointer)(
struct __pyx_memoryview_obj *, PyObject *);
1430 PyObject *(*is_slice)(
struct __pyx_memoryview_obj *, PyObject *);
1431 PyObject *(*setitem_slice_assignment)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1432 PyObject *(*setitem_slice_assign_scalar)(
struct __pyx_memoryview_obj *,
struct __pyx_memoryview_obj *, PyObject *);
1433 PyObject *(*setitem_indexed)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1434 PyObject *(*convert_item_to_object)(
struct __pyx_memoryview_obj *,
char *);
1435 PyObject *(*assign_item_from_object)(
struct __pyx_memoryview_obj *,
char *, PyObject *);
1437 static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;
1448 struct __pyx_vtabstruct__memoryviewslice {
1449 struct __pyx_vtabstruct_memoryview __pyx_base;
1451 static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
1455 #ifndef CYTHON_REFNANNY
1456 #define CYTHON_REFNANNY 0
1460 void (*INCREF)(
void*, PyObject*, int);
1461 void (*DECREF)(
void*, PyObject*, int);
1462 void (*GOTREF)(
void*, PyObject*, int);
1463 void (*GIVEREF)(
void*, PyObject*, int);
1464 void* (*SetupContext)(
const char*, int,
const char*);
1465 void (*FinishContext)(
void**);
1466 } __Pyx_RefNannyAPIStruct;
1467 static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1468 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname);
1469 #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1471 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1473 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1474 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1475 PyGILState_Release(__pyx_gilstate_save);\
1477 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1480 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1481 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
1483 #define __Pyx_RefNannyFinishContext()\
1484 __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
1485 #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1486 #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1487 #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1488 #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1489 #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
1490 #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
1491 #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
1492 #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
1494 #define __Pyx_RefNannyDeclarations
1495 #define __Pyx_RefNannySetupContext(name, acquire_gil)
1496 #define __Pyx_RefNannyFinishContext()
1497 #define __Pyx_INCREF(r) Py_INCREF(r)
1498 #define __Pyx_DECREF(r) Py_DECREF(r)
1499 #define __Pyx_GOTREF(r)
1500 #define __Pyx_GIVEREF(r)
1501 #define __Pyx_XINCREF(r) Py_XINCREF(r)
1502 #define __Pyx_XDECREF(r) Py_XDECREF(r)
1503 #define __Pyx_XGOTREF(r)
1504 #define __Pyx_XGIVEREF(r)
1506 #define __Pyx_XDECREF_SET(r, v) do {\
1507 PyObject *tmp = (PyObject *) r;\
1508 r = v; __Pyx_XDECREF(tmp);\
1510 #define __Pyx_DECREF_SET(r, v) do {\
1511 PyObject *tmp = (PyObject *) r;\
1512 r = v; __Pyx_DECREF(tmp);\
1514 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
1515 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
1518 #if CYTHON_USE_TYPE_SLOTS
1519 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1521 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1525 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1528 static void __Pyx_RaiseArgtupleInvalid(
const char* func_name,
int exact,
1529 Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1532 static void __Pyx_RaiseDoubleKeywordsError(
const char* func_name, PyObject* kw_name);
1535 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1536 PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1537 const char* function_name);
1540 #if CYTHON_USE_TYPE_SLOTS
1541 #define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL)
1542 static CYTHON_INLINE
int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value);
1544 #define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n)
1545 #define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
1549 #if CYTHON_FAST_PYCCALL
1550 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
1552 #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
1556 #if CYTHON_FAST_PYCALL
1557 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
1558 __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
1559 #if 1 || PY_VERSION_HEX < 0x030600B1
1560 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
1562 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
1564 #define __Pyx_BUILD_ASSERT_EXPR(cond)\
1565 (sizeof(char [1 - 2*!(cond)]) - 1)
1566 #ifndef Py_MEMBER_SIZE
1567 #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
1569 static size_t __pyx_pyframe_localsplus_offset = 0;
1570 #include "frameobject.h"
1571 #define __Pxy_PyFrame_Initialize_Offsets()\
1572 ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
1573 (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
1574 #define __Pyx_PyFrame_GetLocalsplus(frame)\
1575 (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
1579 #if CYTHON_COMPILING_IN_CPYTHON
1580 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1582 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
1586 #if CYTHON_COMPILING_IN_CPYTHON
1587 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
1591 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
1594 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
1595 ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
1596 __Pyx__ArgTypeTest(obj, type, name, exact))
1597 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type,
const char *name,
int exact);
1600 #if CYTHON_FAST_THREAD_STATE
1601 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
1602 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
1603 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
1605 #define __Pyx_PyThreadState_declare
1606 #define __Pyx_PyThreadState_assign
1607 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
1611 #if CYTHON_FAST_THREAD_STATE
1612 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
1613 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
1614 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
1615 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
1616 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
1617 static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1618 static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1619 #if CYTHON_COMPILING_IN_CPYTHON
1620 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
1622 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1625 #define __Pyx_PyErr_Clear() PyErr_Clear()
1626 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1627 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
1628 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
1629 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
1630 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
1631 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
1632 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
1636 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1639 static CYTHON_INLINE
int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
1642 #define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d
1643 #define __Pyx_MEMVIEW_DIRECT 1
1644 #define __Pyx_MEMVIEW_PTR 2
1645 #define __Pyx_MEMVIEW_FULL 4
1646 #define __Pyx_MEMVIEW_CONTIG 8
1647 #define __Pyx_MEMVIEW_STRIDED 16
1648 #define __Pyx_MEMVIEW_FOLLOW 32
1649 #define __Pyx_IS_C_CONTIG 1
1650 #define __Pyx_IS_F_CONTIG 2
1651 static int __Pyx_init_memviewslice(
1652 struct __pyx_memoryview_obj *memview,
1654 __Pyx_memviewslice *memviewslice,
1655 int memview_is_new_reference);
1656 static CYTHON_INLINE
int __pyx_add_acquisition_count_locked(
1657 __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
1658 static CYTHON_INLINE
int __pyx_sub_acquisition_count_locked(
1659 __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
1660 #define __pyx_get_slice_count_pointer(memview) (memview->acquisition_count_aligned_p)
1661 #define __pyx_get_slice_count(memview) (*__pyx_get_slice_count_pointer(memview))
1662 #define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__)
1663 #define __PYX_XDEC_MEMVIEW(slice, have_gil) __Pyx_XDEC_MEMVIEW(slice, have_gil, __LINE__)
1664 static CYTHON_INLINE
void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *,
int,
int);
1665 static CYTHON_INLINE
void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *,
int,
int);
1668 static void __Pyx_RaiseBufferIndexError(
int axis);
1671 static void __Pyx_WriteUnraisable(
const char *name,
int clineno,
1672 int lineno,
const char *filename,
1673 int full_traceback,
int nogil);
1676 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
1677 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key);
1678 #define __Pyx_PyObject_Dict_GetItem(obj, name)\
1679 (likely(PyDict_CheckExact(obj)) ?\
1680 __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name))
1682 #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
1683 #define __Pyx_PyObject_Dict_GetItem(obj, name) PyObject_GetItem(obj, name)
1687 static CYTHON_INLINE
void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
1690 static CYTHON_INLINE
void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
1693 static CYTHON_INLINE
void __Pyx_RaiseNoneNotIterableError(
void);
1696 #if CYTHON_USE_EXC_INFO_STACK
1697 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
1701 #if CYTHON_FAST_THREAD_STATE
1702 #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
1703 static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1704 #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
1705 static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1707 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
1708 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
1712 #if CYTHON_FAST_THREAD_STATE
1713 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
1714 static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
1716 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
1720 #if CYTHON_FAST_THREAD_STATE
1721 #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
1722 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1724 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
1728 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject*
function, PyObject* arg1, PyObject* arg2);
1734 static CYTHON_INLINE
int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2,
int equals);
1737 static CYTHON_INLINE
int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2,
int equals);
1740 #if PY_MAJOR_VERSION >= 3
1741 #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
1743 #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
1747 static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t);
1750 #define UNARY_NEG_WOULD_OVERFLOW(x)\
1751 (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
1753 static CYTHON_UNUSED
int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
1754 static PyObject *__pyx_array_get_memview(
struct __pyx_array_obj *);
1756 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
1759 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1760 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1761 __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
1762 (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
1763 __Pyx_GetItemInt_Generic(o, to_py_func(i))))
1764 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1765 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1766 __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1767 (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1768 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
1769 int wraparound,
int boundscheck);
1770 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1771 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1772 __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1773 (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
1774 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
1775 int wraparound,
int boundscheck);
1776 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
1777 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
1778 int is_list,
int wraparound,
int boundscheck);
1781 #if CYTHON_USE_TYPE_SLOTS
1782 static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
1784 #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
1788 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(
const char *
s, Py_ssize_t size,
const char *errors) {
1790 return PyUnicode_DecodeUTF16(
s, size, errors, &byteorder);
1792 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(
const char *
s, Py_ssize_t size,
const char *errors) {
1794 return PyUnicode_DecodeUTF16(
s, size, errors, &byteorder);
1796 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(
const char *
s, Py_ssize_t size,
const char *errors) {
1798 return PyUnicode_DecodeUTF16(
s, size, errors, &byteorder);
1802 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
1803 const char* cstring, Py_ssize_t start, Py_ssize_t stop,
1804 const char* encoding,
const char* errors,
1805 PyObject* (*decode_func)(
const char *
s, Py_ssize_t size,
const char *errors));
1808 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
1811 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
1812 #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
1813 #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
1814 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
1815 (version_var) = __PYX_GET_DICT_VERSION(dict);\
1816 (cache_var) = (value);
1817 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
1818 static PY_UINT64_T __pyx_dict_version = 0;\
1819 static PyObject *__pyx_dict_cached_value = NULL;\
1820 if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
1821 (VAR) = __pyx_dict_cached_value;\
1823 (VAR) = __pyx_dict_cached_value = (LOOKUP);\
1824 __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
1827 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
1828 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
1829 static CYTHON_INLINE
int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
1831 #define __PYX_GET_DICT_VERSION(dict) (0)
1832 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
1833 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
1837 #if CYTHON_USE_DICT_VERSIONS
1838 #define __Pyx_GetModuleGlobalName(var, name) {\
1839 static PY_UINT64_T __pyx_dict_version = 0;\
1840 static PyObject *__pyx_dict_cached_value = NULL;\
1841 (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
1842 (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
1843 __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1845 #define __Pyx_GetModuleGlobalNameUncached(var, name) {\
1846 PY_UINT64_T __pyx_dict_version;\
1847 PyObject *__pyx_dict_cached_value;\
1848 (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1850 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
1852 #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1853 #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1854 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
1858 #if CYTHON_FAST_THREAD_STATE
1859 #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
1860 static CYTHON_INLINE
void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1862 static CYTHON_INLINE
void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
1866 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list,
int level);
1869 #if CYTHON_COMPILING_IN_CPYTHON
1870 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
1871 static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
1872 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
1873 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
1875 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
1876 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
1877 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
1879 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
1881 static CYTHON_UNUSED
int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
1883 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
1884 static CYTHON_INLINE
int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
1885 PyListObject*
L = (PyListObject*) list;
1886 Py_ssize_t len = Py_SIZE(list);
1887 if (likely(
L->allocated > len)) {
1889 PyList_SET_ITEM(list, len, x);
1890 __Pyx_SET_SIZE(list, len + 1);
1893 return PyList_Append(list, x);
1896 #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
1900 #if !CYTHON_COMPILING_IN_PYPY
1901 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2,
long intval,
int inplace,
int zerodivision_check);
1903 #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\
1904 (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
1908 static CYTHON_INLINE
int __Pyx_PyList_Extend(PyObject*
L, PyObject*
v) {
1909 #if CYTHON_COMPILING_IN_CPYTHON
1910 PyObject* none = _PyList_Extend((PyListObject*)
L,
v);
1911 if (unlikely(!none))
1916 return PyList_SetSlice(
L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX,
v);
1921 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
1922 static CYTHON_INLINE
int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
1923 PyListObject*
L = (PyListObject*) list;
1924 Py_ssize_t len = Py_SIZE(list);
1925 if (likely(
L->allocated > len) & likely(len > (
L->allocated >> 1))) {
1927 PyList_SET_ITEM(list, len, x);
1928 __Pyx_SET_SIZE(list, len + 1);
1931 return PyList_Append(list, x);
1934 #define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
1938 static CYTHON_INLINE
void __Pyx_RaiseUnboundLocalError(
const char *varname);
1941 static CYTHON_INLINE
long __Pyx_div_long(
long,
long);
1944 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
1947 static CYTHON_INLINE
int __Pyx_HasAttr(PyObject *, PyObject *);
1950 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
1951 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
1953 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
1957 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
1958 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
1960 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
1964 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);
1967 static int __Pyx_setup_reduce(PyObject* type_obj);
1970 static int __Pyx_SetVtable(PyObject *dict,
void *vtable);
1973 #ifndef __PYX_HAVE_RT_ImportType_proto
1974 #define __PYX_HAVE_RT_ImportType_proto
1975 enum __Pyx_ImportType_CheckSize {
1976 __Pyx_ImportType_CheckSize_Error = 0,
1977 __Pyx_ImportType_CheckSize_Warn = 1,
1978 __Pyx_ImportType_CheckSize_Ignore = 2
1980 static PyTypeObject *__Pyx_ImportType(PyObject* module,
const char *module_name,
const char *class_name,
size_t size,
enum __Pyx_ImportType_CheckSize check_size);
1984 static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases);
1987 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
1990 #define __Pyx_CyFunction_USED 1
1991 #define __Pyx_CYFUNCTION_STATICMETHOD 0x01
1992 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02
1993 #define __Pyx_CYFUNCTION_CCLASS 0x04
1994 #define __Pyx_CyFunction_GetClosure(f)\
1995 (((__pyx_CyFunctionObject *) (f))->func_closure)
1996 #define __Pyx_CyFunction_GetClassObj(f)\
1997 (((__pyx_CyFunctionObject *) (f))->func_classobj)
1998 #define __Pyx_CyFunction_Defaults(type, f)\
1999 ((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
2000 #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
2001 ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
2003 PyCFunctionObject func;
2004 #if PY_VERSION_HEX < 0x030500A0
2005 PyObject *func_weakreflist;
2007 PyObject *func_dict;
2008 PyObject *func_name;
2009 PyObject *func_qualname;
2011 PyObject *func_globals;
2012 PyObject *func_code;
2013 PyObject *func_closure;
2014 PyObject *func_classobj;
2016 int defaults_pyobjects;
2017 size_t defaults_size;
2019 PyObject *defaults_tuple;
2020 PyObject *defaults_kwdict;
2021 PyObject *(*defaults_getter)(PyObject *);
2022 PyObject *func_annotations;
2023 } __pyx_CyFunctionObject;
2024 static PyTypeObject *__pyx_CyFunctionType = 0;
2025 #define __Pyx_CyFunction_Check(obj) (__Pyx_TypeCheck(obj, __pyx_CyFunctionType))
2026 static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml,
2027 int flags, PyObject* qualname,
2029 PyObject *module, PyObject *globals,
2031 static CYTHON_INLINE
void *__Pyx_CyFunction_InitDefaults(PyObject *m,
2034 static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
2036 static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
2038 static CYTHON_INLINE
void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
2040 static int __pyx_CyFunction_init(
void);
2043 static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
2044 int flags, PyObject* qualname,
2046 PyObject *module, PyObject *globals,
2050 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
2051 #define __Pyx_SetNameInClass(ns, name, value)\
2052 (likely(PyDict_CheckExact(ns)) ? _PyDict_SetItem_KnownHash(ns, name, value, ((PyASCIIObject *) name)->hash) : PyObject_SetItem(ns, name, value))
2053 #elif CYTHON_COMPILING_IN_CPYTHON
2054 #define __Pyx_SetNameInClass(ns, name, value)\
2055 (likely(PyDict_CheckExact(ns)) ? PyDict_SetItem(ns, name, value) : PyObject_SetItem(ns, name, value))
2057 #define __Pyx_SetNameInClass(ns, name, value) PyObject_SetItem(ns, name, value)
2061 static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname,
2062 PyObject *mkw, PyObject *modname, PyObject *doc);
2063 static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict,
2064 PyObject *mkw,
int calculate_metaclass,
int allow_py2_metaclass);
2067 #ifdef CYTHON_CLINE_IN_TRACEBACK
2068 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
2070 static int __Pyx_CLineForTraceback(PyThreadState *tstate,
int c_line);
2075 PyCodeObject* code_object;
2077 } __Pyx_CodeObjectCacheEntry;
2078 struct __Pyx_CodeObjectCache {
2081 __Pyx_CodeObjectCacheEntry* entries;
2083 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
2084 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line);
2085 static PyCodeObject *__pyx_find_code_object(
int code_line);
2086 static void __pyx_insert_code_object(
int code_line, PyCodeObject* code_object);
2089 static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
2090 int py_line,
const char *filename);
2092 #if PY_MAJOR_VERSION < 3
2093 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view,
int flags);
2094 static void __Pyx_ReleaseBuffer(Py_buffer *view);
2096 #define __Pyx_GetBuffer PyObject_GetBuffer
2097 #define __Pyx_ReleaseBuffer PyBuffer_Release
2103 Py_ssize_t shape, strides, suboffsets;
2104 } __Pyx_Buf_DimInfo;
2110 __Pyx_Buffer *rcbuffer;
2112 __Pyx_Buf_DimInfo diminfo[8];
2113 } __Pyx_LocalBuf_ND;
2116 static int __pyx_memviewslice_is_contig(
const __Pyx_memviewslice mvs,
char order,
int ndim);
2119 static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
2120 __Pyx_memviewslice *slice2,
2121 int ndim,
size_t itemsize);
2124 static CYTHON_INLINE PyObject *__pyx_capsule_create(
void *p,
const char *sig);
2129 #define __Pyx_CREAL(z) ((z).real())
2130 #define __Pyx_CIMAG(z) ((z).imag())
2132 #define __Pyx_CREAL(z) (__real__(z))
2133 #define __Pyx_CIMAG(z) (__imag__(z))
2136 #define __Pyx_CREAL(z) ((z).real)
2137 #define __Pyx_CIMAG(z) ((z).imag)
2139 #if defined(__cplusplus) && CYTHON_CCOMPLEX\
2140 && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
2141 #define __Pyx_SET_CREAL(z,x) ((z).real(x))
2142 #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
2144 #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
2145 #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
2150 #define __Pyx_c_eq_float(a, b) ((a)==(b))
2151 #define __Pyx_c_sum_float(a, b) ((a)+(b))
2152 #define __Pyx_c_diff_float(a, b) ((a)-(b))
2153 #define __Pyx_c_prod_float(a, b) ((a)*(b))
2154 #define __Pyx_c_quot_float(a, b) ((a)/(b))
2155 #define __Pyx_c_neg_float(a) (-(a))
2157 #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
2158 #define __Pyx_c_conj_float(z) (::std::conj(z))
2160 #define __Pyx_c_abs_float(z) (::std::abs(z))
2161 #define __Pyx_c_pow_float(a, b) (::std::pow(a, b))
2164 #define __Pyx_c_is_zero_float(z) ((z)==0)
2165 #define __Pyx_c_conj_float(z) (conjf(z))
2167 #define __Pyx_c_abs_float(z) (cabsf(z))
2168 #define __Pyx_c_pow_float(a, b) (cpowf(a, b))
2172 static CYTHON_INLINE
int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
2173 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
2174 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
2175 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
2176 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
2177 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
2178 static CYTHON_INLINE
int __Pyx_c_is_zero_float(__pyx_t_float_complex);
2179 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
2181 static CYTHON_INLINE
float __Pyx_c_abs_float(__pyx_t_float_complex);
2182 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
2188 #define __Pyx_c_eq_double(a, b) ((a)==(b))
2189 #define __Pyx_c_sum_double(a, b) ((a)+(b))
2190 #define __Pyx_c_diff_double(a, b) ((a)-(b))
2191 #define __Pyx_c_prod_double(a, b) ((a)*(b))
2192 #define __Pyx_c_quot_double(a, b) ((a)/(b))
2193 #define __Pyx_c_neg_double(a) (-(a))
2195 #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
2196 #define __Pyx_c_conj_double(z) (::std::conj(z))
2198 #define __Pyx_c_abs_double(z) (::std::abs(z))
2199 #define __Pyx_c_pow_double(a, b) (::std::pow(a, b))
2202 #define __Pyx_c_is_zero_double(z) ((z)==0)
2203 #define __Pyx_c_conj_double(z) (conj(z))
2205 #define __Pyx_c_abs_double(z) (cabs(z))
2206 #define __Pyx_c_pow_double(a, b) (cpow(a, b))
2210 static CYTHON_INLINE
int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
2211 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
2212 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
2213 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
2214 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
2215 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
2216 static CYTHON_INLINE
int __Pyx_c_is_zero_double(__pyx_t_double_complex);
2217 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
2219 static CYTHON_INLINE
double __Pyx_c_abs_double(__pyx_t_double_complex);
2220 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
2225 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(
int value);
2228 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(
enum NPY_TYPES value);
2231 static __Pyx_memviewslice
2232 __pyx_memoryview_copy_new_contig(
const __Pyx_memviewslice *from_mvs,
2233 const char *mode,
int ndim,
2234 size_t sizeof_dtype,
int contig_flag,
2235 int dtype_is_object);
2238 static CYTHON_INLINE
int __Pyx_PyInt_As_int(PyObject *);
2241 static CYTHON_INLINE
long __Pyx_PyInt_As_long(PyObject *);
2244 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(
long value);
2247 static CYTHON_INLINE
char __Pyx_PyInt_As_char(PyObject *);
2250 static CYTHON_INLINE
int __Pyx_Is_Little_Endian(
void);
2253 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx,
const char* ts);
2254 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
2255 __Pyx_BufFmt_StackElem* stack,
2256 __Pyx_TypeInfo* type);
2259 static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b);
2262 static int __Pyx_ValidateAndInit_memviewslice(
2267 __Pyx_TypeInfo *dtype,
2268 __Pyx_BufFmt_StackElem stack[],
2269 __Pyx_memviewslice *memviewslice,
2270 PyObject *original_obj);
2273 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_double(PyObject *,
int writable_flag);
2276 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_int(PyObject *,
int writable_flag);
2279 static int __Pyx_check_binary_version(
void);
2282 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
2284 static PyObject *__pyx_array_get_memview(
struct __pyx_array_obj *__pyx_v_self);
2285 static char *__pyx_memoryview_get_item_pointer(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index);
2286 static PyObject *__pyx_memoryview_is_slice(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj);
2287 static PyObject *__pyx_memoryview_setitem_slice_assignment(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src);
2288 static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(
struct __pyx_memoryview_obj *__pyx_v_self,
struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value);
2289 static PyObject *__pyx_memoryview_setitem_indexed(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value);
2290 static PyObject *__pyx_memoryview_convert_item_to_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp);
2291 static PyObject *__pyx_memoryview_assign_item_from_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value);
2292 static PyObject *__pyx_memoryviewslice_convert_item_to_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp);
2293 static PyObject *__pyx_memoryviewslice_assign_item_from_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value);
2306 static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
2319 static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
2320 static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
2321 static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
2322 static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
2323 static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
2324 static CYTHON_INLINE
char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *,
char *,
char *,
int *);
2327 static PyTypeObject *__pyx_ptype_7proteus_15superluWrappers_cSparseMatrix = 0;
2334 static PyTypeObject *__pyx_ptype_10csmoothers_cASMFactor = 0;
2335 static PyTypeObject *__pyx_ptype_10csmoothers_cBASMFactor = 0;
2336 static PyTypeObject *__pyx_array_type = 0;
2337 static PyTypeObject *__pyx_MemviewEnum_type = 0;
2338 static PyTypeObject *__pyx_memoryview_type = 0;
2339 static PyTypeObject *__pyx_memoryviewslice_type = 0;
2340 static PyObject *
generic = 0;
2341 static PyObject *strided = 0;
2342 static PyObject *indirect = 0;
2343 static PyObject *contiguous = 0;
2344 static PyObject *indirect_contiguous = 0;
2345 static int __pyx_memoryview_thread_locks_used;
2346 static PyThread_type_lock __pyx_memoryview_thread_locks[8];
2347 static void __pyx_f_10csmoothers_smootherWrappersjacobi_NR_prepare(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *,
double,
double, __pyx_t_10csmoothers_DDATA);
2348 static void __pyx_f_10csmoothers_smootherWrappersjacobi_NR_solve(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *, __pyx_t_10csmoothers_DDATA, __pyx_t_10csmoothers_DDATA, __pyx_t_10csmoothers_IDATA, __pyx_t_10csmoothers_DDATA);
2349 static void __pyx_f_10csmoothers_smootherWrappersnl_jacobi_NR_solve(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *, __pyx_t_10csmoothers_DDATA, __pyx_t_10csmoothers_IDATA,
double,
double, __pyx_t_10csmoothers_DDATA);
2350 static void __pyx_f_10csmoothers_smootherWrappersgauss_seidel_NR_prepare(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *,
double,
double, __pyx_t_10csmoothers_DDATA);
2351 static void __pyx_f_10csmoothers_smootherWrappersgauss_seidel_NR_solve(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *, __pyx_t_10csmoothers_DDATA, __pyx_t_10csmoothers_DDATA, __pyx_t_10csmoothers_IDATA, __pyx_t_10csmoothers_DDATA);
2352 static PyObject *__pyx_f_10csmoothers_smootherWrappers_nl_gauss_seidel_NR_solve(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *, __pyx_t_10csmoothers_DDATA, __pyx_t_10csmoothers_IDATA,
double,
double, __pyx_t_10csmoothers_DDATA);
2353 static void __pyx_f_10csmoothers_smootherWrappers_asm_NR_prepare(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *,
struct __pyx_obj_10csmoothers_cASMFactor *);
2354 static void __pyx_f_10csmoothers_smootherWrappers_asm_NR_solve(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *,
double,
struct __pyx_obj_10csmoothers_cASMFactor *, __pyx_t_10csmoothers_IDATA, __pyx_t_10csmoothers_DDATA, __pyx_t_10csmoothers_DDATA);
2355 static void __pyx_f_10csmoothers_smootherWrappers_basm_NR_prepare(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *,
struct __pyx_obj_10csmoothers_cBASMFactor *);
2356 static void __pyx_f_10csmoothers_smootherWrappers_basm_NR_solve(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *,
double,
struct __pyx_obj_10csmoothers_cBASMFactor *, __pyx_t_10csmoothers_IDATA, __pyx_t_10csmoothers_DDATA, __pyx_t_10csmoothers_DDATA);
2357 static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t,
char *,
char *,
char *);
2358 static void *__pyx_align_pointer(
void *,
size_t);
2359 static PyObject *__pyx_memoryview_new(PyObject *,
int,
int, __Pyx_TypeInfo *);
2360 static CYTHON_INLINE
int __pyx_memoryview_check(PyObject *);
2361 static PyObject *_unellipsify(PyObject *,
int);
2362 static PyObject *assert_direct_dimensions(Py_ssize_t *,
int);
2363 static struct __pyx_memoryview_obj *__pyx_memview_slice(
struct __pyx_memoryview_obj *, PyObject *);
2364 static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *, Py_ssize_t, Py_ssize_t, Py_ssize_t,
int,
int,
int *, Py_ssize_t, Py_ssize_t, Py_ssize_t,
int,
int,
int,
int);
2365 static char *__pyx_pybuffer_index(Py_buffer *,
char *, Py_ssize_t, Py_ssize_t);
2366 static int __pyx_memslice_transpose(__Pyx_memviewslice *);
2367 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice,
int, PyObject *(*)(
char *),
int (*)(
char *, PyObject *),
int);
2368 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(
struct __pyx_memoryview_obj *, __Pyx_memviewslice *);
2369 static void __pyx_memoryview_slice_copy(
struct __pyx_memoryview_obj *, __Pyx_memviewslice *);
2370 static PyObject *__pyx_memoryview_copy_object(
struct __pyx_memoryview_obj *);
2371 static PyObject *__pyx_memoryview_copy_object_from_slice(
struct __pyx_memoryview_obj *, __Pyx_memviewslice *);
2372 static Py_ssize_t abs_py_ssize_t(Py_ssize_t);
2373 static char __pyx_get_best_slice_order(__Pyx_memviewslice *,
int);
2374 static void _copy_strided_to_strided(
char *, Py_ssize_t *,
char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *,
int,
size_t);
2375 static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *,
int,
size_t);
2376 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *,
int);
2377 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t,
int,
char);
2378 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *,
char,
int);
2379 static int __pyx_memoryview_err_extents(
int, Py_ssize_t, Py_ssize_t);
2380 static int __pyx_memoryview_err_dim(PyObject *,
char *,
int);
2381 static int __pyx_memoryview_err(PyObject *,
char *);
2382 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice,
int,
int,
int);
2383 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *,
int,
int);
2384 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *,
int,
int,
int);
2385 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(
char *, Py_ssize_t *, Py_ssize_t *,
int,
int);
2386 static void __pyx_memoryview_refcount_objects_in_slice(
char *, Py_ssize_t *, Py_ssize_t *,
int,
int);
2387 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *,
int,
size_t,
void *,
int);
2388 static void __pyx_memoryview__slice_assign_scalar(
char *, Py_ssize_t *, Py_ssize_t *,
int,
size_t,
void *);
2389 static PyObject *__pyx_unpickle_Enum__set_state(
struct __pyx_MemviewEnum_obj *, PyObject *);
2390 static __Pyx_TypeInfo __Pyx_TypeInfo_double = {
"double", NULL,
sizeof(double), { 0 }, 0,
'R', 0, 0 };
2391 static __Pyx_TypeInfo __Pyx_TypeInfo_int = {
"int", NULL,
sizeof(int), { 0 }, 0, IS_UNSIGNED(
int) ?
'U' :
'I', IS_UNSIGNED(
int), 0 };
2392 #define __Pyx_MODULE_NAME "csmoothers"
2393 extern int __pyx_module_is_main_csmoothers;
2394 int __pyx_module_is_main_csmoothers = 0;
2397 static PyObject *__pyx_builtin_object;
2398 static PyObject *__pyx_builtin_TypeError;
2399 static PyObject *__pyx_builtin_RuntimeError;
2400 static PyObject *__pyx_builtin_ValueError;
2401 static PyObject *__pyx_builtin_ImportError;
2402 static PyObject *__pyx_builtin_MemoryError;
2403 static PyObject *__pyx_builtin_enumerate;
2404 static PyObject *__pyx_builtin_range;
2405 static PyObject *__pyx_builtin_Ellipsis;
2406 static PyObject *__pyx_builtin_id;
2407 static PyObject *__pyx_builtin_IndexError;
2408 static const char __pyx_k_A[] =
"A";
2409 static const char __pyx_k_L[] =
"L";
2410 static const char __pyx_k_M[] =
"M";
2411 static const char __pyx_k_O[] =
"O";
2412 static const char __pyx_k_R[] =
"R";
2413 static const char __pyx_k_c[] =
"c";
2414 static const char __pyx_k_w[] =
"w";
2415 static const char __pyx_k_bs[] =
"bs";
2416 static const char __pyx_k_dX[] =
"dX";
2417 static const char __pyx_k_id[] =
"id";
2418 static const char __pyx_k_nc[] =
"nc";
2419 static const char __pyx_k_np[] =
"np";
2420 static const char __pyx_k_nr[] =
"nr";
2421 static const char __pyx_k_doc[] =
"__doc__";
2422 static const char __pyx_k_new[] =
"__new__";
2423 static const char __pyx_k_obj[] =
"obj";
2424 static const char __pyx_k_tol[] =
"tol";
2425 static const char __pyx_k_base[] =
"base";
2426 static const char __pyx_k_dict[] =
"__dict__";
2427 static const char __pyx_k_init[] =
"__init__";
2428 static const char __pyx_k_main[] =
"__main__";
2429 static const char __pyx_k_mode[] =
"mode";
2430 static const char __pyx_k_name[] =
"name";
2431 static const char __pyx_k_ndim[] =
"ndim";
2432 static const char __pyx_k_pack[] =
"pack";
2433 static const char __pyx_k_self[] =
"self";
2434 static const char __pyx_k_size[] =
"size";
2435 static const char __pyx_k_step[] =
"step";
2436 static const char __pyx_k_stop[] =
"stop";
2437 static const char __pyx_k_test[] =
"__test__";
2438 static const char __pyx_k_ASCII[] =
"ASCII";
2439 static const char __pyx_k_class[] =
"__class__";
2440 static const char __pyx_k_error[] =
"error";
2441 static const char __pyx_k_flags[] =
"flags";
2442 static const char __pyx_k_numpy[] =
"numpy";
2443 static const char __pyx_k_range[] =
"range";
2444 static const char __pyx_k_shape[] =
"shape";
2445 static const char __pyx_k_start[] =
"start";
2446 static const char __pyx_k_encode[] =
"encode";
2447 static const char __pyx_k_format[] =
"format";
2448 static const char __pyx_k_import[] =
"__import__";
2449 static const char __pyx_k_module[] =
"__module__";
2450 static const char __pyx_k_name_2[] =
"__name__";
2451 static const char __pyx_k_object[] =
"object";
2452 static const char __pyx_k_pickle[] =
"pickle";
2453 static const char __pyx_k_reduce[] =
"__reduce__";
2454 static const char __pyx_k_struct[] =
"struct";
2455 static const char __pyx_k_unpack[] =
"unpack";
2456 static const char __pyx_k_update[] =
"update";
2457 static const char __pyx_k_fortran[] =
"fortran";
2458 static const char __pyx_k_memview[] =
"memview";
2459 static const char __pyx_k_prepare[] =
"__prepare__";
2460 static const char __pyx_k_Ellipsis[] =
"Ellipsis";
2461 static const char __pyx_k_getstate[] =
"__getstate__";
2462 static const char __pyx_k_itemsize[] =
"itemsize";
2463 static const char __pyx_k_pyx_type[] =
"__pyx_type";
2464 static const char __pyx_k_qualname[] =
"__qualname__";
2465 static const char __pyx_k_setstate[] =
"__setstate__";
2466 static const char __pyx_k_ASMFactor[] =
"ASMFactor";
2467 static const char __pyx_k_TypeError[] =
"TypeError";
2468 static const char __pyx_k_asmFactor[] =
"asmFactor";
2469 static const char __pyx_k_enumerate[] =
"enumerate";
2470 static const char __pyx_k_metaclass[] =
"__metaclass__";
2471 static const char __pyx_k_pyx_state[] =
"__pyx_state";
2472 static const char __pyx_k_reduce_ex[] =
"__reduce_ex__";
2473 static const char __pyx_k_BASMFactor[] =
"BASMFactor";
2474 static const char __pyx_k_IndexError[] =
"IndexError";
2475 static const char __pyx_k_ValueError[] =
"ValueError";
2476 static const char __pyx_k_basmFactor[] =
"basmFactor";
2477 static const char __pyx_k_cASMFactor[] =
"_cASMFactor";
2478 static const char __pyx_k_csmoothers[] =
"csmoothers";
2479 static const char __pyx_k_node_order[] =
"node_order";
2480 static const char __pyx_k_pyx_result[] =
"__pyx_result";
2481 static const char __pyx_k_pyx_vtable[] =
"__pyx_vtable__";
2482 static const char __pyx_k_ImportError[] =
"ImportError";
2483 static const char __pyx_k_MemoryError[] =
"MemoryError";
2484 static const char __pyx_k_PickleError[] =
"PickleError";
2485 static const char __pyx_k_cBASMFactor[] =
"_cBASMFactor";
2486 static const char __pyx_k_RuntimeError[] =
"RuntimeError";
2487 static const char __pyx_k_asm_NR_solve[] =
"asm_NR_solve";
2488 static const char __pyx_k_cASMFactor_2[] =
"cASMFactor";
2489 static const char __pyx_k_pyx_checksum[] =
"__pyx_checksum";
2490 static const char __pyx_k_stringsource[] =
"stringsource";
2491 static const char __pyx_k_basm_NR_solve[] =
"basm_NR_solve";
2492 static const char __pyx_k_cBASMFactor_2[] =
"cBASMFactor";
2493 static const char __pyx_k_cSparseMatrix[] =
"_cSparseMatrix";
2494 static const char __pyx_k_pyx_getbuffer[] =
"__pyx_getbuffer";
2495 static const char __pyx_k_reduce_cython[] =
"__reduce_cython__";
2496 static const char __pyx_k_asm_NR_prepare[] =
"asm_NR_prepare";
2497 static const char __pyx_k_View_MemoryView[] =
"View.MemoryView";
2498 static const char __pyx_k_allocate_buffer[] =
"allocate_buffer";
2499 static const char __pyx_k_basm_NR_prepare[] =
"basm_NR_prepare";
2500 static const char __pyx_k_dtype_is_object[] =
"dtype_is_object";
2501 static const char __pyx_k_jacobi_NR_solve[] =
"jacobi_NR_solve";
2502 static const char __pyx_k_pyx_PickleError[] =
"__pyx_PickleError";
2503 static const char __pyx_k_setstate_cython[] =
"__setstate_cython__";
2504 static const char __pyx_k_ASMFactor___init[] =
"ASMFactor.__init__";
2505 static const char __pyx_k_BASMFactor___init[] =
"BASMFactor.__init__";
2506 static const char __pyx_k_jacobi_NR_prepare[] =
"jacobi_NR_prepare";
2507 static const char __pyx_k_pyx_unpickle_Enum[] =
"__pyx_unpickle_Enum";
2508 static const char __pyx_k_cline_in_traceback[] =
"cline_in_traceback";
2509 static const char __pyx_k_nl_jacobi_NR_solve[] =
"nl_jacobi_NR_solve";
2510 static const char __pyx_k_strided_and_direct[] =
"<strided and direct>";
2511 static const char __pyx_k_strided_and_indirect[] =
"<strided and indirect>";
2512 static const char __pyx_k_contiguous_and_direct[] =
"<contiguous and direct>";
2513 static const char __pyx_k_gauss_seidel_NR_solve[] =
"gauss_seidel_NR_solve";
2514 static const char __pyx_k_MemoryView_of_r_object[] =
"<MemoryView of %r object>";
2515 static const char __pyx_k_gauss_seidel_NR_preare[] =
"gauss_seidel_NR_preare";
2516 static const char __pyx_k_proteus_csmoothers_pyx[] =
"proteus/csmoothers.pyx";
2517 static const char __pyx_k_MemoryView_of_r_at_0x_x[] =
"<MemoryView of %r at 0x%x>";
2518 static const char __pyx_k_contiguous_and_indirect[] =
"<contiguous and indirect>";
2519 static const char __pyx_k_Cannot_index_with_type_s[] =
"Cannot index with type '%s'";
2520 static const char __pyx_k_nl_gauss_seidel_NR_solve[] =
"nl_gauss_seidel_NR_solve";
2521 static const char __pyx_k_Invalid_shape_in_axis_d_d[] =
"Invalid shape in axis %d: %d.";
2522 static const char __pyx_k_itemsize_0_for_cython_array[] =
"itemsize <= 0 for cython.array";
2523 static const char __pyx_k_unable_to_allocate_array_data[] =
"unable to allocate array data.";
2524 static const char __pyx_k_strided_and_direct_or_indirect[] =
"<strided and direct or indirect>";
2525 static const char __pyx_k_numpy_core_multiarray_failed_to[] =
"numpy.core.multiarray failed to import";
2526 static const char __pyx_k_unknown_dtype_code_in_numpy_pxd[] =
"unknown dtype code in numpy.pxd (%d)";
2527 static const char __pyx_k_Buffer_view_does_not_expose_stri[] =
"Buffer view does not expose strides";
2528 static const char __pyx_k_Can_only_create_a_buffer_that_is[] =
"Can only create a buffer that is contiguous in memory.";
2529 static const char __pyx_k_Cannot_assign_to_read_only_memor[] =
"Cannot assign to read-only memoryview";
2530 static const char __pyx_k_Cannot_create_writable_memory_vi[] =
"Cannot create writable memory view from read-only memoryview";
2531 static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] =
"Empty shape tuple for cython.array";
2532 static const char __pyx_k_Format_string_allocated_too_shor[] =
"Format string allocated too short, see comment in numpy.pxd";
2533 static const char __pyx_k_Incompatible_checksums_s_vs_0xb0[] =
"Incompatible checksums (%s vs 0xb068931 = (name))";
2534 static const char __pyx_k_Indirect_dimensions_not_supporte[] =
"Indirect dimensions not supported";
2535 static const char __pyx_k_Invalid_mode_expected_c_or_fortr[] =
"Invalid mode, expected 'c' or 'fortran', got %s";
2536 static const char __pyx_k_Non_native_byte_order_not_suppor[] =
"Non-native byte order not supported";
2537 static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] =
"Out of bounds on buffer access (axis %d)";
2538 static const char __pyx_k_Unable_to_convert_item_to_object[] =
"Unable to convert item to object";
2539 static const char __pyx_k_got_differing_extents_in_dimensi[] =
"got differing extents in dimension %d (got %d and %d)";
2540 static const char __pyx_k_no_default___reduce___due_to_non[] =
"no default __reduce__ due to non-trivial __cinit__";
2541 static const char __pyx_k_numpy_core_umath_failed_to_impor[] =
"numpy.core.umath failed to import";
2542 static const char __pyx_k_unable_to_allocate_shape_and_str[] =
"unable to allocate shape and strides.";
2543 static const char __pyx_k_Format_string_allocated_too_shor_2[] =
"Format string allocated too short.";
2544 static PyObject *__pyx_n_s_A;
2545 static PyObject *__pyx_n_s_ASCII;
2546 static PyObject *__pyx_n_s_ASMFactor;
2547 static PyObject *__pyx_n_s_ASMFactor___init;
2548 static PyObject *__pyx_n_s_BASMFactor;
2549 static PyObject *__pyx_n_s_BASMFactor___init;
2550 static PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri;
2551 static PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is;
2552 static PyObject *__pyx_kp_s_Cannot_assign_to_read_only_memor;
2553 static PyObject *__pyx_kp_s_Cannot_create_writable_memory_vi;
2554 static PyObject *__pyx_kp_s_Cannot_index_with_type_s;
2555 static PyObject *__pyx_n_s_Ellipsis;
2556 static PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr;
2557 static PyObject *__pyx_kp_u_Format_string_allocated_too_shor;
2558 static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2;
2559 static PyObject *__pyx_n_s_ImportError;
2560 static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0xb0;
2561 static PyObject *__pyx_n_s_IndexError;
2562 static PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte;
2563 static PyObject *__pyx_kp_s_Invalid_mode_expected_c_or_fortr;
2564 static PyObject *__pyx_kp_s_Invalid_shape_in_axis_d_d;
2565 static PyObject *__pyx_n_s_L;
2566 static PyObject *__pyx_n_s_M;
2567 static PyObject *__pyx_n_s_MemoryError;
2568 static PyObject *__pyx_kp_s_MemoryView_of_r_at_0x_x;
2569 static PyObject *__pyx_kp_s_MemoryView_of_r_object;
2570 static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor;
2571 static PyObject *__pyx_n_b_O;
2572 static PyObject *__pyx_kp_s_Out_of_bounds_on_buffer_access_a;
2573 static PyObject *__pyx_n_s_PickleError;
2574 static PyObject *__pyx_n_s_R;
2575 static PyObject *__pyx_n_s_RuntimeError;
2576 static PyObject *__pyx_n_s_TypeError;
2577 static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object;
2578 static PyObject *__pyx_n_s_ValueError;
2579 static PyObject *__pyx_n_s_View_MemoryView;
2580 static PyObject *__pyx_n_s_allocate_buffer;
2581 static PyObject *__pyx_n_s_asmFactor;
2582 static PyObject *__pyx_n_s_asm_NR_prepare;
2583 static PyObject *__pyx_n_s_asm_NR_solve;
2584 static PyObject *__pyx_n_s_base;
2585 static PyObject *__pyx_n_s_basmFactor;
2586 static PyObject *__pyx_n_s_basm_NR_prepare;
2587 static PyObject *__pyx_n_s_basm_NR_solve;
2588 static PyObject *__pyx_n_s_bs;
2589 static PyObject *__pyx_n_s_c;
2590 static PyObject *__pyx_n_u_c;
2591 static PyObject *__pyx_n_s_cASMFactor;
2592 static PyObject *__pyx_n_s_cASMFactor_2;
2593 static PyObject *__pyx_n_s_cBASMFactor;
2594 static PyObject *__pyx_n_s_cBASMFactor_2;
2595 static PyObject *__pyx_n_s_cSparseMatrix;
2596 static PyObject *__pyx_n_s_class;
2597 static PyObject *__pyx_n_s_cline_in_traceback;
2598 static PyObject *__pyx_kp_s_contiguous_and_direct;
2599 static PyObject *__pyx_kp_s_contiguous_and_indirect;
2600 static PyObject *__pyx_n_s_csmoothers;
2601 static PyObject *__pyx_n_s_dX;
2602 static PyObject *__pyx_n_s_dict;
2603 static PyObject *__pyx_n_s_doc;
2604 static PyObject *__pyx_n_s_dtype_is_object;
2605 static PyObject *__pyx_n_s_encode;
2606 static PyObject *__pyx_n_s_enumerate;
2607 static PyObject *__pyx_n_s_error;
2608 static PyObject *__pyx_n_s_flags;
2609 static PyObject *__pyx_n_s_format;
2610 static PyObject *__pyx_n_s_fortran;
2611 static PyObject *__pyx_n_u_fortran;
2612 static PyObject *__pyx_n_s_gauss_seidel_NR_preare;
2613 static PyObject *__pyx_n_s_gauss_seidel_NR_solve;
2614 static PyObject *__pyx_n_s_getstate;
2615 static PyObject *__pyx_kp_s_got_differing_extents_in_dimensi;
2616 static PyObject *__pyx_n_s_id;
2617 static PyObject *__pyx_n_s_import;
2618 static PyObject *__pyx_n_s_init;
2619 static PyObject *__pyx_n_s_itemsize;
2620 static PyObject *__pyx_kp_s_itemsize_0_for_cython_array;
2621 static PyObject *__pyx_n_s_jacobi_NR_prepare;
2622 static PyObject *__pyx_n_s_jacobi_NR_solve;
2623 static PyObject *__pyx_n_s_main;
2624 static PyObject *__pyx_n_s_memview;
2625 static PyObject *__pyx_n_s_metaclass;
2626 static PyObject *__pyx_n_s_mode;
2627 static PyObject *__pyx_n_s_module;
2628 static PyObject *__pyx_n_s_name;
2629 static PyObject *__pyx_n_s_name_2;
2630 static PyObject *__pyx_n_s_nc;
2631 static PyObject *__pyx_n_s_ndim;
2632 static PyObject *__pyx_n_s_new;
2633 static PyObject *__pyx_n_s_nl_gauss_seidel_NR_solve;
2634 static PyObject *__pyx_n_s_nl_jacobi_NR_solve;
2635 static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
2636 static PyObject *__pyx_n_s_node_order;
2637 static PyObject *__pyx_n_s_np;
2638 static PyObject *__pyx_n_s_nr;
2639 static PyObject *__pyx_n_s_numpy;
2640 static PyObject *__pyx_kp_s_numpy_core_multiarray_failed_to;
2641 static PyObject *__pyx_kp_s_numpy_core_umath_failed_to_impor;
2642 static PyObject *__pyx_n_s_obj;
2643 static PyObject *__pyx_n_s_object;
2644 static PyObject *__pyx_n_s_pack;
2645 static PyObject *__pyx_n_s_pickle;
2646 static PyObject *__pyx_n_s_prepare;
2647 static PyObject *__pyx_kp_s_proteus_csmoothers_pyx;
2648 static PyObject *__pyx_n_s_pyx_PickleError;
2649 static PyObject *__pyx_n_s_pyx_checksum;
2650 static PyObject *__pyx_n_s_pyx_getbuffer;
2651 static PyObject *__pyx_n_s_pyx_result;
2652 static PyObject *__pyx_n_s_pyx_state;
2653 static PyObject *__pyx_n_s_pyx_type;
2654 static PyObject *__pyx_n_s_pyx_unpickle_Enum;
2655 static PyObject *__pyx_n_s_pyx_vtable;
2656 static PyObject *__pyx_n_s_qualname;
2657 static PyObject *__pyx_n_s_range;
2658 static PyObject *__pyx_n_s_reduce;
2659 static PyObject *__pyx_n_s_reduce_cython;
2660 static PyObject *__pyx_n_s_reduce_ex;
2661 static PyObject *__pyx_n_s_self;
2662 static PyObject *__pyx_n_s_setstate;
2663 static PyObject *__pyx_n_s_setstate_cython;
2664 static PyObject *__pyx_n_s_shape;
2665 static PyObject *__pyx_n_s_size;
2666 static PyObject *__pyx_n_s_start;
2667 static PyObject *__pyx_n_s_step;
2668 static PyObject *__pyx_n_s_stop;
2669 static PyObject *__pyx_kp_s_strided_and_direct;
2670 static PyObject *__pyx_kp_s_strided_and_direct_or_indirect;
2671 static PyObject *__pyx_kp_s_strided_and_indirect;
2672 static PyObject *__pyx_kp_s_stringsource;
2673 static PyObject *__pyx_n_s_struct;
2674 static PyObject *__pyx_n_s_test;
2675 static PyObject *__pyx_n_s_tol;
2676 static PyObject *__pyx_kp_s_unable_to_allocate_array_data;
2677 static PyObject *__pyx_kp_s_unable_to_allocate_shape_and_str;
2678 static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd;
2679 static PyObject *__pyx_n_s_unpack;
2680 static PyObject *__pyx_n_s_update;
2681 static PyObject *__pyx_n_s_w;
2682 static PyObject *__pyx_pf_10csmoothers_9ASMFactor___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_L);
2683 static int __pyx_pf_10csmoothers_10cASMFactor___cinit__(
struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_self,
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_L);
2684 static void __pyx_pf_10csmoothers_10cASMFactor_2__dealloc__(
struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_self);
2685 static PyObject *__pyx_pf_10csmoothers_10cASMFactor_4__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_self);
2686 static PyObject *__pyx_pf_10csmoothers_10cASMFactor_6__setstate_cython__(CYTHON_UNUSED
struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
2687 static PyObject *__pyx_pf_10csmoothers_10BASMFactor___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_L, PyObject *__pyx_v_bs);
2688 static int __pyx_pf_10csmoothers_11cBASMFactor___cinit__(
struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_self,
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_L,
int __pyx_v_bs);
2689 static void __pyx_pf_10csmoothers_11cBASMFactor_2__dealloc__(
struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_self);
2690 static PyObject *__pyx_pf_10csmoothers_11cBASMFactor_4__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_self);
2691 static PyObject *__pyx_pf_10csmoothers_11cBASMFactor_6__setstate_cython__(CYTHON_UNUSED
struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
2692 static PyObject *__pyx_pf_10csmoothers_jacobi_NR_prepare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_w, PyObject *__pyx_v_tol, PyObject *__pyx_v_M);
2693 static PyObject *__pyx_pf_10csmoothers_2jacobi_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_M, PyObject *__pyx_v_R, PyObject *__pyx_v_node_order, PyObject *__pyx_v_dX);
2694 static PyObject *__pyx_pf_10csmoothers_4nl_jacobi_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_R, PyObject *__pyx_v_node_order, PyObject *__pyx_v_w, PyObject *__pyx_v_tol, PyObject *__pyx_v_dX);
2695 static PyObject *__pyx_pf_10csmoothers_6gauss_seidel_NR_preare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_w, PyObject *__pyx_v_tol, PyObject *__pyx_v_M);
2696 static PyObject *__pyx_pf_10csmoothers_8gauss_seidel_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_M, PyObject *__pyx_v_R, PyObject *__pyx_v_node_order, PyObject *__pyx_v_dX);
2697 static PyObject *__pyx_pf_10csmoothers_10nl_gauss_seidel_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_R, PyObject *__pyx_v_node_order, PyObject *__pyx_v_w, PyObject *__pyx_v_tol, PyObject *__pyx_v_dX);
2698 static PyObject *__pyx_pf_10csmoothers_12asm_NR_prepare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_asmFactor);
2699 static PyObject *__pyx_pf_10csmoothers_14asm_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_w, PyObject *__pyx_v_asmFactor, PyObject *__pyx_v_node_order, PyObject *__pyx_v_R, PyObject *__pyx_v_dX);
2700 static PyObject *__pyx_pf_10csmoothers_16basm_NR_prepare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_basmFactor);
2701 static PyObject *__pyx_pf_10csmoothers_18basm_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_w, PyObject *__pyx_v_basmFactor, PyObject *__pyx_v_node_order, PyObject *__pyx_v_R, PyObject *__pyx_v_dX);
2702 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode,
int __pyx_v_allocate_buffer);
2703 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(
struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
2704 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(
struct __pyx_array_obj *__pyx_v_self);
2705 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(
struct __pyx_array_obj *__pyx_v_self);
2706 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(
struct __pyx_array_obj *__pyx_v_self);
2707 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr);
2708 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item);
2709 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value);
2710 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED
struct __pyx_array_obj *__pyx_v_self);
2711 static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
2712 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name);
2713 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(
struct __pyx_MemviewEnum_obj *__pyx_v_self);
2714 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self);
2715 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state);
2716 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj,
int __pyx_v_flags,
int __pyx_v_dtype_is_object);
2717 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(
struct __pyx_memoryview_obj *__pyx_v_self);
2718 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index);
2719 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value);
2720 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(
struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
2721 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2722 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2723 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2724 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2725 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2726 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2727 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2728 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2729 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2730 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(
struct __pyx_memoryview_obj *__pyx_v_self);
2731 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(
struct __pyx_memoryview_obj *__pyx_v_self);
2732 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(
struct __pyx_memoryview_obj *__pyx_v_self);
2733 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(
struct __pyx_memoryview_obj *__pyx_v_self);
2734 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(
struct __pyx_memoryview_obj *__pyx_v_self);
2735 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(
struct __pyx_memoryview_obj *__pyx_v_self);
2736 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(
struct __pyx_memoryview_obj *__pyx_v_self);
2737 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryview_obj *__pyx_v_self);
2738 static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
2739 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(
struct __pyx_memoryviewslice_obj *__pyx_v_self);
2740 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(
struct __pyx_memoryviewslice_obj *__pyx_v_self);
2741 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryviewslice_obj *__pyx_v_self);
2742 static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
2743 static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type,
long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state);
2744 static PyObject *__pyx_tp_new_10csmoothers_cASMFactor(PyTypeObject *t, PyObject *a, PyObject *k);
2745 static PyObject *__pyx_tp_new_10csmoothers_cBASMFactor(PyTypeObject *t, PyObject *a, PyObject *k);
2746 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k);
2747 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k);
2748 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k);
2749 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k);
2750 static PyObject *__pyx_int_0;
2751 static PyObject *__pyx_int_1;
2752 static PyObject *__pyx_int_184977713;
2753 static PyObject *__pyx_int_neg_1;
2754 static PyObject *__pyx_tuple_;
2755 static PyObject *__pyx_tuple__2;
2756 static PyObject *__pyx_tuple__3;
2757 static PyObject *__pyx_tuple__4;
2758 static PyObject *__pyx_tuple__5;
2759 static PyObject *__pyx_tuple__6;
2760 static PyObject *__pyx_tuple__7;
2761 static PyObject *__pyx_tuple__8;
2762 static PyObject *__pyx_tuple__9;
2763 static PyObject *__pyx_slice__24;
2764 static PyObject *__pyx_tuple__10;
2765 static PyObject *__pyx_tuple__11;
2766 static PyObject *__pyx_tuple__12;
2767 static PyObject *__pyx_tuple__13;
2768 static PyObject *__pyx_tuple__14;
2769 static PyObject *__pyx_tuple__15;
2770 static PyObject *__pyx_tuple__16;
2771 static PyObject *__pyx_tuple__17;
2772 static PyObject *__pyx_tuple__18;
2773 static PyObject *__pyx_tuple__19;
2774 static PyObject *__pyx_tuple__20;
2775 static PyObject *__pyx_tuple__21;
2776 static PyObject *__pyx_tuple__22;
2777 static PyObject *__pyx_tuple__23;
2778 static PyObject *__pyx_tuple__25;
2779 static PyObject *__pyx_tuple__26;
2780 static PyObject *__pyx_tuple__27;
2781 static PyObject *__pyx_tuple__28;
2782 static PyObject *__pyx_tuple__29;
2783 static PyObject *__pyx_tuple__31;
2784 static PyObject *__pyx_tuple__32;
2785 static PyObject *__pyx_tuple__34;
2786 static PyObject *__pyx_tuple__36;
2787 static PyObject *__pyx_tuple__38;
2788 static PyObject *__pyx_tuple__40;
2789 static PyObject *__pyx_tuple__42;
2790 static PyObject *__pyx_tuple__44;
2791 static PyObject *__pyx_tuple__46;
2792 static PyObject *__pyx_tuple__48;
2793 static PyObject *__pyx_tuple__50;
2794 static PyObject *__pyx_tuple__52;
2795 static PyObject *__pyx_tuple__54;
2796 static PyObject *__pyx_tuple__55;
2797 static PyObject *__pyx_tuple__56;
2798 static PyObject *__pyx_tuple__57;
2799 static PyObject *__pyx_tuple__58;
2800 static PyObject *__pyx_tuple__59;
2801 static PyObject *__pyx_codeobj__30;
2802 static PyObject *__pyx_codeobj__33;
2803 static PyObject *__pyx_codeobj__35;
2804 static PyObject *__pyx_codeobj__37;
2805 static PyObject *__pyx_codeobj__39;
2806 static PyObject *__pyx_codeobj__41;
2807 static PyObject *__pyx_codeobj__43;
2808 static PyObject *__pyx_codeobj__45;
2809 static PyObject *__pyx_codeobj__47;
2810 static PyObject *__pyx_codeobj__49;
2811 static PyObject *__pyx_codeobj__51;
2812 static PyObject *__pyx_codeobj__53;
2813 static PyObject *__pyx_codeobj__60;
2825 static PyObject *__pyx_pw_10csmoothers_9ASMFactor_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
2826 static PyMethodDef __pyx_mdef_10csmoothers_9ASMFactor_1__init__ = {
"__init__", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_10csmoothers_9ASMFactor_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
2827 static PyObject *__pyx_pw_10csmoothers_9ASMFactor_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2828 PyObject *__pyx_v_self = 0;
2829 PyObject *__pyx_v_L = 0;
2830 int __pyx_lineno = 0;
2831 const char *__pyx_filename = NULL;
2832 int __pyx_clineno = 0;
2833 PyObject *__pyx_r = 0;
2834 __Pyx_RefNannyDeclarations
2835 __Pyx_RefNannySetupContext(
"__init__ (wrapper)", 0);
2837 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_L,0};
2838 PyObject* values[2] = {0,0};
2839 if (unlikely(__pyx_kwds)) {
2841 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2843 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2845 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2848 default:
goto __pyx_L5_argtuple_error;
2850 kw_args = PyDict_Size(__pyx_kwds);
2853 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
2854 else goto __pyx_L5_argtuple_error;
2857 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_L)) != 0)) kw_args--;
2859 __Pyx_RaiseArgtupleInvalid(
"__init__", 1, 2, 2, 1); __PYX_ERR(0, 7, __pyx_L3_error)
2862 if (unlikely(kw_args > 0)) {
2863 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__init__") < 0)) __PYX_ERR(0, 7, __pyx_L3_error)
2865 }
else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
2866 goto __pyx_L5_argtuple_error;
2868 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2869 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2871 __pyx_v_self = values[0];
2872 __pyx_v_L = values[1];
2874 goto __pyx_L4_argument_unpacking_done;
2875 __pyx_L5_argtuple_error:;
2876 __Pyx_RaiseArgtupleInvalid(
"__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 7, __pyx_L3_error)
2878 __Pyx_AddTraceback(
"csmoothers.ASMFactor.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2879 __Pyx_RefNannyFinishContext();
2881 __pyx_L4_argument_unpacking_done:;
2882 __pyx_r = __pyx_pf_10csmoothers_9ASMFactor___init__(__pyx_self, __pyx_v_self, __pyx_v_L);
2885 __Pyx_RefNannyFinishContext();
2889 static PyObject *__pyx_pf_10csmoothers_9ASMFactor___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_L) {
2890 PyObject *__pyx_r = NULL;
2891 __Pyx_RefNannyDeclarations
2892 PyObject *__pyx_t_1 = NULL;
2893 PyObject *__pyx_t_2 = NULL;
2894 int __pyx_lineno = 0;
2895 const char *__pyx_filename = NULL;
2896 int __pyx_clineno = 0;
2897 __Pyx_RefNannySetupContext(
"__init__", 0);
2906 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_L, __pyx_v_L) < 0) __PYX_ERR(0, 8, __pyx_L1_error)
2915 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_L);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 9, __pyx_L1_error)
2916 __Pyx_GOTREF(__pyx_t_1);
2917 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_cSparseMatrix);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9, __pyx_L1_error)
2918 __Pyx_GOTREF(__pyx_t_2);
2919 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2920 __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_10csmoothers_cASMFactor), __pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 9, __pyx_L1_error)
2921 __Pyx_GOTREF(__pyx_t_1);
2922 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2923 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_cASMFactor, __pyx_t_1) < 0) __PYX_ERR(0, 9, __pyx_L1_error)
2924 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2935 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2938 __Pyx_XDECREF(__pyx_t_1);
2939 __Pyx_XDECREF(__pyx_t_2);
2940 __Pyx_AddTraceback(
"csmoothers.ASMFactor.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2943 __Pyx_XGIVEREF(__pyx_r);
2944 __Pyx_RefNannyFinishContext();
2957 static int __pyx_pw_10csmoothers_10cASMFactor_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
2958 static int __pyx_pw_10csmoothers_10cASMFactor_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2959 struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_L = 0;
2960 int __pyx_lineno = 0;
2961 const char *__pyx_filename = NULL;
2962 int __pyx_clineno = 0;
2964 __Pyx_RefNannyDeclarations
2965 __Pyx_RefNannySetupContext(
"__cinit__ (wrapper)", 0);
2967 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_L,0};
2968 PyObject* values[1] = {0};
2969 if (unlikely(__pyx_kwds)) {
2971 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2973 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2976 default:
goto __pyx_L5_argtuple_error;
2978 kw_args = PyDict_Size(__pyx_kwds);
2981 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_L)) != 0)) kw_args--;
2982 else goto __pyx_L5_argtuple_error;
2984 if (unlikely(kw_args > 0)) {
2985 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__cinit__") < 0)) __PYX_ERR(0, 13, __pyx_L3_error)
2987 }
else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
2988 goto __pyx_L5_argtuple_error;
2990 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2992 __pyx_v_L = ((
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)values[0]);
2994 goto __pyx_L4_argument_unpacking_done;
2995 __pyx_L5_argtuple_error:;
2996 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 13, __pyx_L3_error)
2998 __Pyx_AddTraceback(
"csmoothers.cASMFactor.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2999 __Pyx_RefNannyFinishContext();
3001 __pyx_L4_argument_unpacking_done:;
3002 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_L), __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix, 1,
"L", 0))) __PYX_ERR(0, 14, __pyx_L1_error)
3003 __pyx_r = __pyx_pf_10csmoothers_10cASMFactor___cinit__(((
struct __pyx_obj_10csmoothers_cASMFactor *)__pyx_v_self), __pyx_v_L);
3010 __Pyx_RefNannyFinishContext();
3014 static int __pyx_pf_10csmoothers_10cASMFactor___cinit__(
struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_self,
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_L) {
3016 __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
3018 __Pyx_RefNannyDeclarations
3019 PyObject *__pyx_t_1 = NULL;
3021 int __pyx_lineno = 0;
3022 const char *__pyx_filename = NULL;
3023 int __pyx_clineno = 0;
3024 __Pyx_RefNannySetupContext(
"__cinit__", 0);
3042 __pyx_v_AS.Stype = SLU_NR;
3051 __pyx_v_AS.Dtype = SLU_D;
3060 __pyx_v_AS.Mtype = SLU_GE;
3069 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_L), __pyx_n_s_nr);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 20, __pyx_L1_error)
3070 __Pyx_GOTREF(__pyx_t_1);
3071 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 20, __pyx_L1_error)
3072 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3073 __pyx_v_AS.nrow = __pyx_t_2;
3082 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_L), __pyx_n_s_nc);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 21, __pyx_L1_error)
3083 __Pyx_GOTREF(__pyx_t_1);
3084 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 21, __pyx_L1_error)
3085 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3086 __pyx_v_AS.ncol = __pyx_t_2;
3095 __pyx_v_AS.Store = (&__pyx_v_L->A);
3104 __pyx_v_rval =
asm_NR_init((&__pyx_v_AS), (&__pyx_v_self->subdomain_dim), (&__pyx_v_self->l2g_L), (&__pyx_v_self->subdomain_L), (&__pyx_v_self->subdomain_R), (&__pyx_v_self->subdomain_dX), (&__pyx_v_self->subdomain_pivots));
3113 #ifndef CYTHON_WITHOUT_ASSERTIONS
3114 if (unlikely(!Py_OptimizeFlag)) {
3115 if (unlikely(!((__pyx_v_rval == 0) != 0))) {
3116 PyErr_SetNone(PyExc_AssertionError);
3117 __PYX_ERR(0, 30, __pyx_L1_error)
3134 __Pyx_XDECREF(__pyx_t_1);
3135 __Pyx_AddTraceback(
"csmoothers.cASMFactor.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3138 __Pyx_RefNannyFinishContext();
3151 static void __pyx_pw_10csmoothers_10cASMFactor_3__dealloc__(PyObject *__pyx_v_self);
3152 static void __pyx_pw_10csmoothers_10cASMFactor_3__dealloc__(PyObject *__pyx_v_self) {
3153 __Pyx_RefNannyDeclarations
3154 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
3155 __pyx_pf_10csmoothers_10cASMFactor_2__dealloc__(((
struct __pyx_obj_10csmoothers_cASMFactor *)__pyx_v_self));
3158 __Pyx_RefNannyFinishContext();
3161 static void __pyx_pf_10csmoothers_10cASMFactor_2__dealloc__(
struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_self) {
3162 __Pyx_RefNannyDeclarations
3163 __Pyx_RefNannySetupContext(
"__dealloc__", 0);
3172 asm_NR_free(__pyx_v_self->N, __pyx_v_self->subdomain_dim, __pyx_v_self->l2g_L, __pyx_v_self->subdomain_L, __pyx_v_self->subdomain_R, __pyx_v_self->subdomain_dX, __pyx_v_self->subdomain_pivots);
3183 __Pyx_RefNannyFinishContext();
3193 static PyObject *__pyx_pw_10csmoothers_10cASMFactor_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
3194 static PyObject *__pyx_pw_10csmoothers_10cASMFactor_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
3195 PyObject *__pyx_r = 0;
3196 __Pyx_RefNannyDeclarations
3197 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
3198 __pyx_r = __pyx_pf_10csmoothers_10cASMFactor_4__reduce_cython__(((
struct __pyx_obj_10csmoothers_cASMFactor *)__pyx_v_self));
3201 __Pyx_RefNannyFinishContext();
3205 static PyObject *__pyx_pf_10csmoothers_10cASMFactor_4__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_self) {
3206 PyObject *__pyx_r = NULL;
3207 __Pyx_RefNannyDeclarations
3208 PyObject *__pyx_t_1 = NULL;
3209 int __pyx_lineno = 0;
3210 const char *__pyx_filename = NULL;
3211 int __pyx_clineno = 0;
3212 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
3220 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple_, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
3221 __Pyx_GOTREF(__pyx_t_1);
3222 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
3223 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3224 __PYX_ERR(1, 2, __pyx_L1_error)
3234 __Pyx_XDECREF(__pyx_t_1);
3235 __Pyx_AddTraceback(
"csmoothers.cASMFactor.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3237 __Pyx_XGIVEREF(__pyx_r);
3238 __Pyx_RefNannyFinishContext();
3250 static PyObject *__pyx_pw_10csmoothers_10cASMFactor_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
3251 static PyObject *__pyx_pw_10csmoothers_10cASMFactor_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
3252 PyObject *__pyx_r = 0;
3253 __Pyx_RefNannyDeclarations
3254 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
3255 __pyx_r = __pyx_pf_10csmoothers_10cASMFactor_6__setstate_cython__(((
struct __pyx_obj_10csmoothers_cASMFactor *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
3258 __Pyx_RefNannyFinishContext();
3262 static PyObject *__pyx_pf_10csmoothers_10cASMFactor_6__setstate_cython__(CYTHON_UNUSED
struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
3263 PyObject *__pyx_r = NULL;
3264 __Pyx_RefNannyDeclarations
3265 PyObject *__pyx_t_1 = NULL;
3266 int __pyx_lineno = 0;
3267 const char *__pyx_filename = NULL;
3268 int __pyx_clineno = 0;
3269 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
3276 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__2, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
3277 __Pyx_GOTREF(__pyx_t_1);
3278 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
3279 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3280 __PYX_ERR(1, 4, __pyx_L1_error)
3291 __Pyx_XDECREF(__pyx_t_1);
3292 __Pyx_AddTraceback(
"csmoothers.cASMFactor.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3294 __Pyx_XGIVEREF(__pyx_r);
3295 __Pyx_RefNannyFinishContext();
3308 static PyObject *__pyx_pw_10csmoothers_10BASMFactor_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
3309 static PyMethodDef __pyx_mdef_10csmoothers_10BASMFactor_1__init__ = {
"__init__", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_10csmoothers_10BASMFactor_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
3310 static PyObject *__pyx_pw_10csmoothers_10BASMFactor_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3311 PyObject *__pyx_v_self = 0;
3312 PyObject *__pyx_v_L = 0;
3313 PyObject *__pyx_v_bs = 0;
3314 int __pyx_lineno = 0;
3315 const char *__pyx_filename = NULL;
3316 int __pyx_clineno = 0;
3317 PyObject *__pyx_r = 0;
3318 __Pyx_RefNannyDeclarations
3319 __Pyx_RefNannySetupContext(
"__init__ (wrapper)", 0);
3321 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_L,&__pyx_n_s_bs,0};
3322 PyObject* values[3] = {0,0,0};
3323 if (unlikely(__pyx_kwds)) {
3325 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3327 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3329 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3331 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3334 default:
goto __pyx_L5_argtuple_error;
3336 kw_args = PyDict_Size(__pyx_kwds);
3339 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
3340 else goto __pyx_L5_argtuple_error;
3343 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_L)) != 0)) kw_args--;
3345 __Pyx_RaiseArgtupleInvalid(
"__init__", 1, 3, 3, 1); __PYX_ERR(0, 44, __pyx_L3_error)
3349 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bs)) != 0)) kw_args--;
3351 __Pyx_RaiseArgtupleInvalid(
"__init__", 1, 3, 3, 2); __PYX_ERR(0, 44, __pyx_L3_error)
3354 if (unlikely(kw_args > 0)) {
3355 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__init__") < 0)) __PYX_ERR(0, 44, __pyx_L3_error)
3357 }
else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
3358 goto __pyx_L5_argtuple_error;
3360 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3361 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3362 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3364 __pyx_v_self = values[0];
3365 __pyx_v_L = values[1];
3366 __pyx_v_bs = values[2];
3368 goto __pyx_L4_argument_unpacking_done;
3369 __pyx_L5_argtuple_error:;
3370 __Pyx_RaiseArgtupleInvalid(
"__init__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 44, __pyx_L3_error)
3372 __Pyx_AddTraceback(
"csmoothers.BASMFactor.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3373 __Pyx_RefNannyFinishContext();
3375 __pyx_L4_argument_unpacking_done:;
3376 __pyx_r = __pyx_pf_10csmoothers_10BASMFactor___init__(__pyx_self, __pyx_v_self, __pyx_v_L, __pyx_v_bs);
3379 __Pyx_RefNannyFinishContext();
3383 static PyObject *__pyx_pf_10csmoothers_10BASMFactor___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_L, PyObject *__pyx_v_bs) {
3384 PyObject *__pyx_r = NULL;
3385 __Pyx_RefNannyDeclarations
3386 PyObject *__pyx_t_1 = NULL;
3387 PyObject *__pyx_t_2 = NULL;
3388 PyObject *__pyx_t_3 = NULL;
3389 int __pyx_lineno = 0;
3390 const char *__pyx_filename = NULL;
3391 int __pyx_clineno = 0;
3392 __Pyx_RefNannySetupContext(
"__init__", 0);
3401 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_L, __pyx_v_L) < 0) __PYX_ERR(0, 45, __pyx_L1_error)
3410 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_bs, __pyx_v_bs) < 0) __PYX_ERR(0, 46, __pyx_L1_error)
3419 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_L);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 47, __pyx_L1_error)
3420 __Pyx_GOTREF(__pyx_t_1);
3421 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_cSparseMatrix);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 47, __pyx_L1_error)
3422 __Pyx_GOTREF(__pyx_t_2);
3423 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3432 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_bs);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 48, __pyx_L1_error)
3433 __Pyx_GOTREF(__pyx_t_1);
3442 __pyx_t_3 = PyTuple_New(2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 47, __pyx_L1_error)
3443 __Pyx_GOTREF(__pyx_t_3);
3444 __Pyx_GIVEREF(__pyx_t_2);
3445 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
3446 __Pyx_GIVEREF(__pyx_t_1);
3447 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
3450 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_10csmoothers_cBASMFactor), __pyx_t_3, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 47, __pyx_L1_error)
3451 __Pyx_GOTREF(__pyx_t_1);
3452 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3453 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_cBASMFactor, __pyx_t_1) < 0) __PYX_ERR(0, 47, __pyx_L1_error)
3454 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3465 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3468 __Pyx_XDECREF(__pyx_t_1);
3469 __Pyx_XDECREF(__pyx_t_2);
3470 __Pyx_XDECREF(__pyx_t_3);
3471 __Pyx_AddTraceback(
"csmoothers.BASMFactor.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3474 __Pyx_XGIVEREF(__pyx_r);
3475 __Pyx_RefNannyFinishContext();
3488 static int __pyx_pw_10csmoothers_11cBASMFactor_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
3489 static int __pyx_pw_10csmoothers_11cBASMFactor_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3490 struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_L = 0;
3492 int __pyx_lineno = 0;
3493 const char *__pyx_filename = NULL;
3494 int __pyx_clineno = 0;
3496 __Pyx_RefNannyDeclarations
3497 __Pyx_RefNannySetupContext(
"__cinit__ (wrapper)", 0);
3499 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_L,&__pyx_n_s_bs,0};
3500 PyObject* values[2] = {0,0};
3501 if (unlikely(__pyx_kwds)) {
3503 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3505 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3507 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3510 default:
goto __pyx_L5_argtuple_error;
3512 kw_args = PyDict_Size(__pyx_kwds);
3515 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_L)) != 0)) kw_args--;
3516 else goto __pyx_L5_argtuple_error;
3519 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bs)) != 0)) kw_args--;
3521 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 1, 2, 2, 1); __PYX_ERR(0, 52, __pyx_L3_error)
3524 if (unlikely(kw_args > 0)) {
3525 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__cinit__") < 0)) __PYX_ERR(0, 52, __pyx_L3_error)
3527 }
else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
3528 goto __pyx_L5_argtuple_error;
3530 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3531 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3533 __pyx_v_L = ((
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)values[0]);
3534 __pyx_v_bs = __Pyx_PyInt_As_int(values[1]);
if (unlikely((__pyx_v_bs == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L3_error)
3536 goto __pyx_L4_argument_unpacking_done;
3537 __pyx_L5_argtuple_error:;
3538 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 52, __pyx_L3_error)
3540 __Pyx_AddTraceback(
"csmoothers.cBASMFactor.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3541 __Pyx_RefNannyFinishContext();
3543 __pyx_L4_argument_unpacking_done:;
3544 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_L), __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix, 1,
"L", 0))) __PYX_ERR(0, 53, __pyx_L1_error)
3545 __pyx_r = __pyx_pf_10csmoothers_11cBASMFactor___cinit__(((
struct __pyx_obj_10csmoothers_cBASMFactor *)__pyx_v_self), __pyx_v_L, __pyx_v_bs);
3552 __Pyx_RefNannyFinishContext();
3556 static int __pyx_pf_10csmoothers_11cBASMFactor___cinit__(
struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_self,
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_L,
int __pyx_v_bs) {
3558 __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
3560 __Pyx_RefNannyDeclarations
3561 PyObject *__pyx_t_1 = NULL;
3563 int __pyx_lineno = 0;
3564 const char *__pyx_filename = NULL;
3565 int __pyx_clineno = 0;
3566 __Pyx_RefNannySetupContext(
"__cinit__", 0);
3584 __pyx_v_AS.Stype = SLU_NR;
3593 __pyx_v_AS.Dtype = SLU_D;
3602 __pyx_v_AS.Mtype = SLU_GE;
3611 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_L), __pyx_n_s_nr);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 60, __pyx_L1_error)
3612 __Pyx_GOTREF(__pyx_t_1);
3613 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 60, __pyx_L1_error)
3614 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3615 __pyx_v_AS.nrow = __pyx_t_2;
3624 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_L), __pyx_n_s_nc);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 61, __pyx_L1_error)
3625 __Pyx_GOTREF(__pyx_t_1);
3626 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 61, __pyx_L1_error)
3627 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3628 __pyx_v_AS.ncol = __pyx_t_2;
3637 __pyx_v_AS.Store = (&__pyx_v_L->A);
3646 __pyx_v_rval =
basm_NR_init(__pyx_v_bs, (&__pyx_v_AS), (&__pyx_v_self->subdomain_dim), (&__pyx_v_self->l2g_L), (&__pyx_v_self->subdomain_L), (&__pyx_v_self->subdomain_R), (&__pyx_v_self->subdomain_dX), (&__pyx_v_self->subdomain_pivots), (&__pyx_v_self->subdomain_col_pivots));
3655 #ifndef CYTHON_WITHOUT_ASSERTIONS
3656 if (unlikely(!Py_OptimizeFlag)) {
3657 if (unlikely(!((__pyx_v_rval == 0) != 0))) {
3658 PyErr_SetNone(PyExc_AssertionError);
3659 __PYX_ERR(0, 72, __pyx_L1_error)
3676 __Pyx_XDECREF(__pyx_t_1);
3677 __Pyx_AddTraceback(
"csmoothers.cBASMFactor.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3680 __Pyx_RefNannyFinishContext();
3693 static void __pyx_pw_10csmoothers_11cBASMFactor_3__dealloc__(PyObject *__pyx_v_self);
3694 static void __pyx_pw_10csmoothers_11cBASMFactor_3__dealloc__(PyObject *__pyx_v_self) {
3695 __Pyx_RefNannyDeclarations
3696 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
3697 __pyx_pf_10csmoothers_11cBASMFactor_2__dealloc__(((
struct __pyx_obj_10csmoothers_cBASMFactor *)__pyx_v_self));
3700 __Pyx_RefNannyFinishContext();
3703 static void __pyx_pf_10csmoothers_11cBASMFactor_2__dealloc__(
struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_self) {
3704 __Pyx_RefNannyDeclarations
3705 __Pyx_RefNannySetupContext(
"__dealloc__", 0);
3714 basm_NR_free(__pyx_v_self->N, __pyx_v_self->subdomain_dim, __pyx_v_self->l2g_L, __pyx_v_self->subdomain_L, __pyx_v_self->subdomain_R, __pyx_v_self->subdomain_dX, __pyx_v_self->subdomain_pivots, __pyx_v_self->subdomain_col_pivots);
3725 __Pyx_RefNannyFinishContext();
3735 static PyObject *__pyx_pw_10csmoothers_11cBASMFactor_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
3736 static PyObject *__pyx_pw_10csmoothers_11cBASMFactor_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
3737 PyObject *__pyx_r = 0;
3738 __Pyx_RefNannyDeclarations
3739 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
3740 __pyx_r = __pyx_pf_10csmoothers_11cBASMFactor_4__reduce_cython__(((
struct __pyx_obj_10csmoothers_cBASMFactor *)__pyx_v_self));
3743 __Pyx_RefNannyFinishContext();
3747 static PyObject *__pyx_pf_10csmoothers_11cBASMFactor_4__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_self) {
3748 PyObject *__pyx_r = NULL;
3749 __Pyx_RefNannyDeclarations
3750 PyObject *__pyx_t_1 = NULL;
3751 int __pyx_lineno = 0;
3752 const char *__pyx_filename = NULL;
3753 int __pyx_clineno = 0;
3754 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
3762 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__3, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
3763 __Pyx_GOTREF(__pyx_t_1);
3764 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
3765 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3766 __PYX_ERR(1, 2, __pyx_L1_error)
3776 __Pyx_XDECREF(__pyx_t_1);
3777 __Pyx_AddTraceback(
"csmoothers.cBASMFactor.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3779 __Pyx_XGIVEREF(__pyx_r);
3780 __Pyx_RefNannyFinishContext();
3792 static PyObject *__pyx_pw_10csmoothers_11cBASMFactor_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
3793 static PyObject *__pyx_pw_10csmoothers_11cBASMFactor_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
3794 PyObject *__pyx_r = 0;
3795 __Pyx_RefNannyDeclarations
3796 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
3797 __pyx_r = __pyx_pf_10csmoothers_11cBASMFactor_6__setstate_cython__(((
struct __pyx_obj_10csmoothers_cBASMFactor *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
3800 __Pyx_RefNannyFinishContext();
3804 static PyObject *__pyx_pf_10csmoothers_11cBASMFactor_6__setstate_cython__(CYTHON_UNUSED
struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
3805 PyObject *__pyx_r = NULL;
3806 __Pyx_RefNannyDeclarations
3807 PyObject *__pyx_t_1 = NULL;
3808 int __pyx_lineno = 0;
3809 const char *__pyx_filename = NULL;
3810 int __pyx_clineno = 0;
3811 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
3818 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__4, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
3819 __Pyx_GOTREF(__pyx_t_1);
3820 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
3821 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3822 __PYX_ERR(1, 4, __pyx_L1_error)
3833 __Pyx_XDECREF(__pyx_t_1);
3834 __Pyx_AddTraceback(
"csmoothers.cBASMFactor.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3836 __Pyx_XGIVEREF(__pyx_r);
3837 __Pyx_RefNannyFinishContext();
3850 static PyObject *__pyx_pw_10csmoothers_1jacobi_NR_prepare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
3851 static char __pyx_doc_10csmoothers_jacobi_NR_prepare[] =
"\n\n Arguments\n ---------\n A : superluWrappers.SparseMatrix\n w : double\n tol : double\n M : np.array\n ";
3852 static PyMethodDef __pyx_mdef_10csmoothers_1jacobi_NR_prepare = {
"jacobi_NR_prepare", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_10csmoothers_1jacobi_NR_prepare, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10csmoothers_jacobi_NR_prepare};
3853 static PyObject *__pyx_pw_10csmoothers_1jacobi_NR_prepare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3854 PyObject *__pyx_v_A = 0;
3855 PyObject *__pyx_v_w = 0;
3856 PyObject *__pyx_v_tol = 0;
3857 PyObject *__pyx_v_M = 0;
3858 int __pyx_lineno = 0;
3859 const char *__pyx_filename = NULL;
3860 int __pyx_clineno = 0;
3861 PyObject *__pyx_r = 0;
3862 __Pyx_RefNannyDeclarations
3863 __Pyx_RefNannySetupContext(
"jacobi_NR_prepare (wrapper)", 0);
3865 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_w,&__pyx_n_s_tol,&__pyx_n_s_M,0};
3866 PyObject* values[4] = {0,0,0,0};
3867 if (unlikely(__pyx_kwds)) {
3869 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3871 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3873 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3875 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3877 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3880 default:
goto __pyx_L5_argtuple_error;
3882 kw_args = PyDict_Size(__pyx_kwds);
3885 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
3886 else goto __pyx_L5_argtuple_error;
3889 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_w)) != 0)) kw_args--;
3891 __Pyx_RaiseArgtupleInvalid(
"jacobi_NR_prepare", 1, 4, 4, 1); __PYX_ERR(0, 84, __pyx_L3_error)
3895 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tol)) != 0)) kw_args--;
3897 __Pyx_RaiseArgtupleInvalid(
"jacobi_NR_prepare", 1, 4, 4, 2); __PYX_ERR(0, 84, __pyx_L3_error)
3901 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_M)) != 0)) kw_args--;
3903 __Pyx_RaiseArgtupleInvalid(
"jacobi_NR_prepare", 1, 4, 4, 3); __PYX_ERR(0, 84, __pyx_L3_error)
3906 if (unlikely(kw_args > 0)) {
3907 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"jacobi_NR_prepare") < 0)) __PYX_ERR(0, 84, __pyx_L3_error)
3909 }
else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
3910 goto __pyx_L5_argtuple_error;
3912 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3913 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3914 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3915 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3917 __pyx_v_A = values[0];
3918 __pyx_v_w = values[1];
3919 __pyx_v_tol = values[2];
3920 __pyx_v_M = values[3];
3922 goto __pyx_L4_argument_unpacking_done;
3923 __pyx_L5_argtuple_error:;
3924 __Pyx_RaiseArgtupleInvalid(
"jacobi_NR_prepare", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 84, __pyx_L3_error)
3926 __Pyx_AddTraceback(
"csmoothers.jacobi_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
3927 __Pyx_RefNannyFinishContext();
3929 __pyx_L4_argument_unpacking_done:;
3930 __pyx_r = __pyx_pf_10csmoothers_jacobi_NR_prepare(__pyx_self, __pyx_v_A, __pyx_v_w, __pyx_v_tol, __pyx_v_M);
3933 __Pyx_RefNannyFinishContext();
3937 static PyObject *__pyx_pf_10csmoothers_jacobi_NR_prepare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_w, PyObject *__pyx_v_tol, PyObject *__pyx_v_M) {
3938 PyObject *__pyx_r = NULL;
3939 __Pyx_RefNannyDeclarations
3940 PyObject *__pyx_t_1 = NULL;
3943 __pyx_t_10csmoothers_DDATA __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
3944 int __pyx_lineno = 0;
3945 const char *__pyx_filename = NULL;
3946 int __pyx_clineno = 0;
3947 __Pyx_RefNannySetupContext(
"jacobi_NR_prepare", 0);
3956 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_cSparseMatrix);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 94, __pyx_L1_error)
3957 __Pyx_GOTREF(__pyx_t_1);
3958 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 94, __pyx_L1_error)
3959 __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_w);
if (unlikely((__pyx_t_2 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 94, __pyx_L1_error)
3960 __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_v_tol);
if (unlikely((__pyx_t_3 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 94, __pyx_L1_error)
3961 __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_M, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(0, 94, __pyx_L1_error)
3962 __pyx_f_10csmoothers_smootherWrappersjacobi_NR_prepare(((
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), __pyx_t_2, __pyx_t_3, __pyx_t_4);
3963 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3964 __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
3965 __pyx_t_4.memview = NULL;
3966 __pyx_t_4.data = NULL;
3977 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3980 __Pyx_XDECREF(__pyx_t_1);
3981 __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
3982 __Pyx_AddTraceback(
"csmoothers.jacobi_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
3985 __Pyx_XGIVEREF(__pyx_r);
3986 __Pyx_RefNannyFinishContext();
3998 static void __pyx_f_10csmoothers_smootherWrappersjacobi_NR_prepare(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm,
double __pyx_v_w,
double __pyx_v_tol, __pyx_t_10csmoothers_DDATA __pyx_v_M) {
3999 __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
4000 __Pyx_RefNannyDeclarations
4001 PyObject *__pyx_t_1 = NULL;
4003 Py_ssize_t __pyx_t_3;
4004 int __pyx_lineno = 0;
4005 const char *__pyx_filename = NULL;
4006 int __pyx_clineno = 0;
4007 __Pyx_RefNannySetupContext(
"smootherWrappersjacobi_NR_prepare", 0);
4016 __pyx_v_AS.Stype = SLU_NR;
4025 __pyx_v_AS.Dtype = SLU_D;
4034 __pyx_v_AS.Mtype = SLU_GE;
4043 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nr);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 104, __pyx_L1_error)
4044 __Pyx_GOTREF(__pyx_t_1);
4045 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 104, __pyx_L1_error)
4046 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4047 __pyx_v_AS.nrow = __pyx_t_2;
4056 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nc);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 105, __pyx_L1_error)
4057 __Pyx_GOTREF(__pyx_t_1);
4058 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 105, __pyx_L1_error)
4059 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4060 __pyx_v_AS.ncol = __pyx_t_2;
4069 __pyx_v_AS.Store = (&__pyx_v_sm->A);
4080 if (__pyx_t_3 < 0) {
4081 __pyx_t_3 += __pyx_v_M.shape[0];
4082 if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
4083 }
else if (unlikely(__pyx_t_3 >= __pyx_v_M.shape[0])) __pyx_t_2 = 0;
4084 if (unlikely(__pyx_t_2 != -1)) {
4085 __Pyx_RaiseBufferIndexError(__pyx_t_2);
4086 __PYX_ERR(0, 107, __pyx_L1_error)
4088 jacobi_NR_prepare((&__pyx_v_AS), __pyx_v_w, __pyx_v_tol, (&(*((
double *) ( (__pyx_v_M.data + __pyx_t_3 * __pyx_v_M.strides[0]) )))));
4101 __Pyx_XDECREF(__pyx_t_1);
4102 __Pyx_WriteUnraisable(
"csmoothers.smootherWrappersjacobi_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
4104 __Pyx_RefNannyFinishContext();
4116 static PyObject *__pyx_pw_10csmoothers_3jacobi_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
4117 static char __pyx_doc_10csmoothers_2jacobi_NR_solve[] =
"\n \n Arguments\n ---------\n A : superluWrappers.SparseMatrix\n M : np.array double\n R : np.array double\n node_order : np.array int\n dX : np.array double\n ";
4118 static PyMethodDef __pyx_mdef_10csmoothers_3jacobi_NR_solve = {
"jacobi_NR_solve", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_10csmoothers_3jacobi_NR_solve, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10csmoothers_2jacobi_NR_solve};
4119 static PyObject *__pyx_pw_10csmoothers_3jacobi_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4120 PyObject *__pyx_v_A = 0;
4121 PyObject *__pyx_v_M = 0;
4122 PyObject *__pyx_v_R = 0;
4123 PyObject *__pyx_v_node_order = 0;
4124 PyObject *__pyx_v_dX = 0;
4125 int __pyx_lineno = 0;
4126 const char *__pyx_filename = NULL;
4127 int __pyx_clineno = 0;
4128 PyObject *__pyx_r = 0;
4129 __Pyx_RefNannyDeclarations
4130 __Pyx_RefNannySetupContext(
"jacobi_NR_solve (wrapper)", 0);
4132 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_M,&__pyx_n_s_R,&__pyx_n_s_node_order,&__pyx_n_s_dX,0};
4133 PyObject* values[5] = {0,0,0,0,0};
4134 if (unlikely(__pyx_kwds)) {
4136 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4138 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4140 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4142 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4144 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4146 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4149 default:
goto __pyx_L5_argtuple_error;
4151 kw_args = PyDict_Size(__pyx_kwds);
4154 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
4155 else goto __pyx_L5_argtuple_error;
4158 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_M)) != 0)) kw_args--;
4160 __Pyx_RaiseArgtupleInvalid(
"jacobi_NR_solve", 1, 5, 5, 1); __PYX_ERR(0, 109, __pyx_L3_error)
4164 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_R)) != 0)) kw_args--;
4166 __Pyx_RaiseArgtupleInvalid(
"jacobi_NR_solve", 1, 5, 5, 2); __PYX_ERR(0, 109, __pyx_L3_error)
4170 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_node_order)) != 0)) kw_args--;
4172 __Pyx_RaiseArgtupleInvalid(
"jacobi_NR_solve", 1, 5, 5, 3); __PYX_ERR(0, 109, __pyx_L3_error)
4176 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dX)) != 0)) kw_args--;
4178 __Pyx_RaiseArgtupleInvalid(
"jacobi_NR_solve", 1, 5, 5, 4); __PYX_ERR(0, 109, __pyx_L3_error)
4181 if (unlikely(kw_args > 0)) {
4182 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"jacobi_NR_solve") < 0)) __PYX_ERR(0, 109, __pyx_L3_error)
4184 }
else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
4185 goto __pyx_L5_argtuple_error;
4187 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4188 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4189 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4190 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4191 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4193 __pyx_v_A = values[0];
4194 __pyx_v_M = values[1];
4195 __pyx_v_R = values[2];
4196 __pyx_v_node_order = values[3];
4197 __pyx_v_dX = values[4];
4199 goto __pyx_L4_argument_unpacking_done;
4200 __pyx_L5_argtuple_error:;
4201 __Pyx_RaiseArgtupleInvalid(
"jacobi_NR_solve", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 109, __pyx_L3_error)
4203 __Pyx_AddTraceback(
"csmoothers.jacobi_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
4204 __Pyx_RefNannyFinishContext();
4206 __pyx_L4_argument_unpacking_done:;
4207 __pyx_r = __pyx_pf_10csmoothers_2jacobi_NR_solve(__pyx_self, __pyx_v_A, __pyx_v_M, __pyx_v_R, __pyx_v_node_order, __pyx_v_dX);
4210 __Pyx_RefNannyFinishContext();
4214 static PyObject *__pyx_pf_10csmoothers_2jacobi_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_M, PyObject *__pyx_v_R, PyObject *__pyx_v_node_order, PyObject *__pyx_v_dX) {
4215 PyObject *__pyx_r = NULL;
4216 __Pyx_RefNannyDeclarations
4217 PyObject *__pyx_t_1 = NULL;
4218 __pyx_t_10csmoothers_DDATA __pyx_t_2 = { 0, 0, { 0 }, { 0 }, { 0 } };
4219 __pyx_t_10csmoothers_DDATA __pyx_t_3 = { 0, 0, { 0 }, { 0 }, { 0 } };
4220 __pyx_t_10csmoothers_IDATA __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
4221 __pyx_t_10csmoothers_DDATA __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
4222 int __pyx_lineno = 0;
4223 const char *__pyx_filename = NULL;
4224 int __pyx_clineno = 0;
4225 __Pyx_RefNannySetupContext(
"jacobi_NR_solve", 0);
4234 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_cSparseMatrix);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 120, __pyx_L1_error)
4235 __Pyx_GOTREF(__pyx_t_1);
4236 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 120, __pyx_L1_error)
4237 __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_M, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(0, 120, __pyx_L1_error)
4238 __pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_R, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 120, __pyx_L1_error)
4239 __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_node_order, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(0, 120, __pyx_L1_error)
4240 __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_dX, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 120, __pyx_L1_error)
4241 __pyx_f_10csmoothers_smootherWrappersjacobi_NR_solve(((
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5);
4242 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4243 __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
4244 __pyx_t_2.memview = NULL;
4245 __pyx_t_2.data = NULL;
4246 __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
4247 __pyx_t_3.memview = NULL;
4248 __pyx_t_3.data = NULL;
4249 __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
4250 __pyx_t_4.memview = NULL;
4251 __pyx_t_4.data = NULL;
4252 __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
4253 __pyx_t_5.memview = NULL;
4254 __pyx_t_5.data = NULL;
4265 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4268 __Pyx_XDECREF(__pyx_t_1);
4269 __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
4270 __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
4271 __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
4272 __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
4273 __Pyx_AddTraceback(
"csmoothers.jacobi_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
4276 __Pyx_XGIVEREF(__pyx_r);
4277 __Pyx_RefNannyFinishContext();
4289 static void __pyx_f_10csmoothers_smootherWrappersjacobi_NR_solve(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm, __pyx_t_10csmoothers_DDATA __pyx_v_M, __pyx_t_10csmoothers_DDATA __pyx_v_R, __pyx_t_10csmoothers_IDATA __pyx_v_node_order, __pyx_t_10csmoothers_DDATA __pyx_v_dX) {
4290 __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
4291 __Pyx_RefNannyDeclarations
4292 PyObject *__pyx_t_1 = NULL;
4294 Py_ssize_t __pyx_t_3;
4295 Py_ssize_t __pyx_t_4;
4296 Py_ssize_t __pyx_t_5;
4297 Py_ssize_t __pyx_t_6;
4298 int __pyx_lineno = 0;
4299 const char *__pyx_filename = NULL;
4300 int __pyx_clineno = 0;
4301 __Pyx_RefNannySetupContext(
"smootherWrappersjacobi_NR_solve", 0);
4310 __pyx_v_AS.Stype = SLU_NR;
4319 __pyx_v_AS.Dtype = SLU_D;
4328 __pyx_v_AS.Mtype = SLU_GE;
4337 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nr);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 131, __pyx_L1_error)
4338 __Pyx_GOTREF(__pyx_t_1);
4339 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 131, __pyx_L1_error)
4340 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4341 __pyx_v_AS.nrow = __pyx_t_2;
4350 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nc);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 132, __pyx_L1_error)
4351 __Pyx_GOTREF(__pyx_t_1);
4352 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 132, __pyx_L1_error)
4353 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4354 __pyx_v_AS.ncol = __pyx_t_2;
4363 __pyx_v_AS.Store = (&__pyx_v_sm->A);
4374 if (__pyx_t_3 < 0) {
4375 __pyx_t_3 += __pyx_v_M.shape[0];
4376 if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
4377 }
else if (unlikely(__pyx_t_3 >= __pyx_v_M.shape[0])) __pyx_t_2 = 0;
4378 if (unlikely(__pyx_t_2 != -1)) {
4379 __Pyx_RaiseBufferIndexError(__pyx_t_2);
4380 __PYX_ERR(0, 134, __pyx_L1_error)
4384 if (__pyx_t_4 < 0) {
4385 __pyx_t_4 += __pyx_v_R.shape[0];
4386 if (unlikely(__pyx_t_4 < 0)) __pyx_t_2 = 0;
4387 }
else if (unlikely(__pyx_t_4 >= __pyx_v_R.shape[0])) __pyx_t_2 = 0;
4388 if (unlikely(__pyx_t_2 != -1)) {
4389 __Pyx_RaiseBufferIndexError(__pyx_t_2);
4390 __PYX_ERR(0, 134, __pyx_L1_error)
4394 if (__pyx_t_5 < 0) {
4395 __pyx_t_5 += __pyx_v_node_order.shape[0];
4396 if (unlikely(__pyx_t_5 < 0)) __pyx_t_2 = 0;
4397 }
else if (unlikely(__pyx_t_5 >= __pyx_v_node_order.shape[0])) __pyx_t_2 = 0;
4398 if (unlikely(__pyx_t_2 != -1)) {
4399 __Pyx_RaiseBufferIndexError(__pyx_t_2);
4400 __PYX_ERR(0, 134, __pyx_L1_error)
4404 if (__pyx_t_6 < 0) {
4405 __pyx_t_6 += __pyx_v_dX.shape[0];
4406 if (unlikely(__pyx_t_6 < 0)) __pyx_t_2 = 0;
4407 }
else if (unlikely(__pyx_t_6 >= __pyx_v_dX.shape[0])) __pyx_t_2 = 0;
4408 if (unlikely(__pyx_t_2 != -1)) {
4409 __Pyx_RaiseBufferIndexError(__pyx_t_2);
4410 __PYX_ERR(0, 134, __pyx_L1_error)
4412 jacobi_NR_solve((&__pyx_v_AS), (&(*((
double *) ( (__pyx_v_M.data + __pyx_t_3 * __pyx_v_M.strides[0]) )))), (&(*((
double *) ( (__pyx_v_R.data + __pyx_t_4 * __pyx_v_R.strides[0]) )))), (&(*((
int *) ( (__pyx_v_node_order.data + __pyx_t_5 * __pyx_v_node_order.strides[0]) )))), (&(*((
double *) ( (__pyx_v_dX.data + __pyx_t_6 * __pyx_v_dX.strides[0]) )))));
4425 __Pyx_XDECREF(__pyx_t_1);
4426 __Pyx_WriteUnraisable(
"csmoothers.smootherWrappersjacobi_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
4428 __Pyx_RefNannyFinishContext();
4440 static PyObject *__pyx_pw_10csmoothers_5nl_jacobi_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
4441 static char __pyx_doc_10csmoothers_4nl_jacobi_NR_solve[] =
"\n\n Arguments\n ---------\n A : superluWrappers.SparseMatrix\n R : np.array double\n node_order : np.array int\n w : np.float\n tol : np.float\n dX : np.array double\n ";
4442 static PyMethodDef __pyx_mdef_10csmoothers_5nl_jacobi_NR_solve = {
"nl_jacobi_NR_solve", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_10csmoothers_5nl_jacobi_NR_solve, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10csmoothers_4nl_jacobi_NR_solve};
4443 static PyObject *__pyx_pw_10csmoothers_5nl_jacobi_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4444 PyObject *__pyx_v_A = 0;
4445 PyObject *__pyx_v_R = 0;
4446 PyObject *__pyx_v_node_order = 0;
4447 PyObject *__pyx_v_w = 0;
4448 PyObject *__pyx_v_tol = 0;
4449 PyObject *__pyx_v_dX = 0;
4450 int __pyx_lineno = 0;
4451 const char *__pyx_filename = NULL;
4452 int __pyx_clineno = 0;
4453 PyObject *__pyx_r = 0;
4454 __Pyx_RefNannyDeclarations
4455 __Pyx_RefNannySetupContext(
"nl_jacobi_NR_solve (wrapper)", 0);
4457 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_R,&__pyx_n_s_node_order,&__pyx_n_s_w,&__pyx_n_s_tol,&__pyx_n_s_dX,0};
4458 PyObject* values[6] = {0,0,0,0,0,0};
4459 if (unlikely(__pyx_kwds)) {
4461 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4463 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
4465 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4467 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4469 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4471 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4473 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4476 default:
goto __pyx_L5_argtuple_error;
4478 kw_args = PyDict_Size(__pyx_kwds);
4481 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
4482 else goto __pyx_L5_argtuple_error;
4485 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_R)) != 0)) kw_args--;
4487 __Pyx_RaiseArgtupleInvalid(
"nl_jacobi_NR_solve", 1, 6, 6, 1); __PYX_ERR(0, 136, __pyx_L3_error)
4491 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_node_order)) != 0)) kw_args--;
4493 __Pyx_RaiseArgtupleInvalid(
"nl_jacobi_NR_solve", 1, 6, 6, 2); __PYX_ERR(0, 136, __pyx_L3_error)
4497 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_w)) != 0)) kw_args--;
4499 __Pyx_RaiseArgtupleInvalid(
"nl_jacobi_NR_solve", 1, 6, 6, 3); __PYX_ERR(0, 136, __pyx_L3_error)
4503 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tol)) != 0)) kw_args--;
4505 __Pyx_RaiseArgtupleInvalid(
"nl_jacobi_NR_solve", 1, 6, 6, 4); __PYX_ERR(0, 136, __pyx_L3_error)
4509 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dX)) != 0)) kw_args--;
4511 __Pyx_RaiseArgtupleInvalid(
"nl_jacobi_NR_solve", 1, 6, 6, 5); __PYX_ERR(0, 136, __pyx_L3_error)
4514 if (unlikely(kw_args > 0)) {
4515 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"nl_jacobi_NR_solve") < 0)) __PYX_ERR(0, 136, __pyx_L3_error)
4517 }
else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
4518 goto __pyx_L5_argtuple_error;
4520 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4521 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4522 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4523 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4524 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4525 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
4527 __pyx_v_A = values[0];
4528 __pyx_v_R = values[1];
4529 __pyx_v_node_order = values[2];
4530 __pyx_v_w = values[3];
4531 __pyx_v_tol = values[4];
4532 __pyx_v_dX = values[5];
4534 goto __pyx_L4_argument_unpacking_done;
4535 __pyx_L5_argtuple_error:;
4536 __Pyx_RaiseArgtupleInvalid(
"nl_jacobi_NR_solve", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 136, __pyx_L3_error)
4538 __Pyx_AddTraceback(
"csmoothers.nl_jacobi_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
4539 __Pyx_RefNannyFinishContext();
4541 __pyx_L4_argument_unpacking_done:;
4542 __pyx_r = __pyx_pf_10csmoothers_4nl_jacobi_NR_solve(__pyx_self, __pyx_v_A, __pyx_v_R, __pyx_v_node_order, __pyx_v_w, __pyx_v_tol, __pyx_v_dX);
4545 __Pyx_RefNannyFinishContext();
4549 static PyObject *__pyx_pf_10csmoothers_4nl_jacobi_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_R, PyObject *__pyx_v_node_order, PyObject *__pyx_v_w, PyObject *__pyx_v_tol, PyObject *__pyx_v_dX) {
4550 PyObject *__pyx_r = NULL;
4551 __Pyx_RefNannyDeclarations
4552 PyObject *__pyx_t_1 = NULL;
4553 __pyx_t_10csmoothers_DDATA __pyx_t_2 = { 0, 0, { 0 }, { 0 }, { 0 } };
4554 __pyx_t_10csmoothers_IDATA __pyx_t_3 = { 0, 0, { 0 }, { 0 }, { 0 } };
4557 __pyx_t_10csmoothers_DDATA __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
4558 int __pyx_lineno = 0;
4559 const char *__pyx_filename = NULL;
4560 int __pyx_clineno = 0;
4561 __Pyx_RefNannySetupContext(
"nl_jacobi_NR_solve", 0);
4570 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_cSparseMatrix);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 148, __pyx_L1_error)
4571 __Pyx_GOTREF(__pyx_t_1);
4572 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 148, __pyx_L1_error)
4573 __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_R, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(0, 148, __pyx_L1_error)
4574 __pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_node_order, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 148, __pyx_L1_error)
4575 __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_v_w);
if (unlikely((__pyx_t_4 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 148, __pyx_L1_error)
4576 __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_v_tol);
if (unlikely((__pyx_t_5 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 148, __pyx_L1_error)
4577 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_dX, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 148, __pyx_L1_error)
4578 __pyx_f_10csmoothers_smootherWrappersnl_jacobi_NR_solve(((
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6);
4579 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4580 __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
4581 __pyx_t_2.memview = NULL;
4582 __pyx_t_2.data = NULL;
4583 __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
4584 __pyx_t_3.memview = NULL;
4585 __pyx_t_3.data = NULL;
4586 __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
4587 __pyx_t_6.memview = NULL;
4588 __pyx_t_6.data = NULL;
4599 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4602 __Pyx_XDECREF(__pyx_t_1);
4603 __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
4604 __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
4605 __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
4606 __Pyx_AddTraceback(
"csmoothers.nl_jacobi_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
4609 __Pyx_XGIVEREF(__pyx_r);
4610 __Pyx_RefNannyFinishContext();
4622 static void __pyx_f_10csmoothers_smootherWrappersnl_jacobi_NR_solve(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm, __pyx_t_10csmoothers_DDATA __pyx_v_R, __pyx_t_10csmoothers_IDATA __pyx_v_node_order,
double __pyx_v_w,
double __pyx_v_tol, __pyx_t_10csmoothers_DDATA __pyx_v_dX) {
4623 __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
4624 __Pyx_RefNannyDeclarations
4625 PyObject *__pyx_t_1 = NULL;
4627 Py_ssize_t __pyx_t_3;
4628 Py_ssize_t __pyx_t_4;
4629 Py_ssize_t __pyx_t_5;
4630 int __pyx_lineno = 0;
4631 const char *__pyx_filename = NULL;
4632 int __pyx_clineno = 0;
4633 __Pyx_RefNannySetupContext(
"smootherWrappersnl_jacobi_NR_solve", 0);
4642 __pyx_v_AS.Stype = SLU_NR;
4651 __pyx_v_AS.Dtype = SLU_D;
4660 __pyx_v_AS.Mtype = SLU_GE;
4669 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nr);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 160, __pyx_L1_error)
4670 __Pyx_GOTREF(__pyx_t_1);
4671 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 160, __pyx_L1_error)
4672 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4673 __pyx_v_AS.nrow = __pyx_t_2;
4682 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nc);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 161, __pyx_L1_error)
4683 __Pyx_GOTREF(__pyx_t_1);
4684 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 161, __pyx_L1_error)
4685 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4686 __pyx_v_AS.ncol = __pyx_t_2;
4695 __pyx_v_AS.Store = (&__pyx_v_sm->A);
4706 if (__pyx_t_3 < 0) {
4707 __pyx_t_3 += __pyx_v_R.shape[0];
4708 if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
4709 }
else if (unlikely(__pyx_t_3 >= __pyx_v_R.shape[0])) __pyx_t_2 = 0;
4710 if (unlikely(__pyx_t_2 != -1)) {
4711 __Pyx_RaiseBufferIndexError(__pyx_t_2);
4712 __PYX_ERR(0, 163, __pyx_L1_error)
4716 if (__pyx_t_4 < 0) {
4717 __pyx_t_4 += __pyx_v_node_order.shape[0];
4718 if (unlikely(__pyx_t_4 < 0)) __pyx_t_2 = 0;
4719 }
else if (unlikely(__pyx_t_4 >= __pyx_v_node_order.shape[0])) __pyx_t_2 = 0;
4720 if (unlikely(__pyx_t_2 != -1)) {
4721 __Pyx_RaiseBufferIndexError(__pyx_t_2);
4722 __PYX_ERR(0, 163, __pyx_L1_error)
4726 if (__pyx_t_5 < 0) {
4727 __pyx_t_5 += __pyx_v_dX.shape[0];
4728 if (unlikely(__pyx_t_5 < 0)) __pyx_t_2 = 0;
4729 }
else if (unlikely(__pyx_t_5 >= __pyx_v_dX.shape[0])) __pyx_t_2 = 0;
4730 if (unlikely(__pyx_t_2 != -1)) {
4731 __Pyx_RaiseBufferIndexError(__pyx_t_2);
4732 __PYX_ERR(0, 163, __pyx_L1_error)
4734 nl_jacobi_NR_solve((&__pyx_v_AS), (&(*((
double *) ( (__pyx_v_R.data + __pyx_t_3 * __pyx_v_R.strides[0]) )))), (&(*((
int *) ( (__pyx_v_node_order.data + __pyx_t_4 * __pyx_v_node_order.strides[0]) )))), __pyx_v_w, __pyx_v_tol, (&(*((
double *) ( (__pyx_v_dX.data + __pyx_t_5 * __pyx_v_dX.strides[0]) )))));
4747 __Pyx_XDECREF(__pyx_t_1);
4748 __Pyx_WriteUnraisable(
"csmoothers.smootherWrappersnl_jacobi_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
4750 __Pyx_RefNannyFinishContext();
4762 static PyObject *__pyx_pw_10csmoothers_7gauss_seidel_NR_preare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
4763 static char __pyx_doc_10csmoothers_6gauss_seidel_NR_preare[] =
"\n\n Arguments\n ---------\n A :\n w :\n tol :\n M :\n ";
4764 static PyMethodDef __pyx_mdef_10csmoothers_7gauss_seidel_NR_preare = {
"gauss_seidel_NR_preare", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_10csmoothers_7gauss_seidel_NR_preare, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10csmoothers_6gauss_seidel_NR_preare};
4765 static PyObject *__pyx_pw_10csmoothers_7gauss_seidel_NR_preare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4766 PyObject *__pyx_v_A = 0;
4767 PyObject *__pyx_v_w = 0;
4768 PyObject *__pyx_v_tol = 0;
4769 PyObject *__pyx_v_M = 0;
4770 int __pyx_lineno = 0;
4771 const char *__pyx_filename = NULL;
4772 int __pyx_clineno = 0;
4773 PyObject *__pyx_r = 0;
4774 __Pyx_RefNannyDeclarations
4775 __Pyx_RefNannySetupContext(
"gauss_seidel_NR_preare (wrapper)", 0);
4777 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_w,&__pyx_n_s_tol,&__pyx_n_s_M,0};
4778 PyObject* values[4] = {0,0,0,0};
4779 if (unlikely(__pyx_kwds)) {
4781 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4783 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4785 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4787 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4789 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4792 default:
goto __pyx_L5_argtuple_error;
4794 kw_args = PyDict_Size(__pyx_kwds);
4797 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
4798 else goto __pyx_L5_argtuple_error;
4801 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_w)) != 0)) kw_args--;
4803 __Pyx_RaiseArgtupleInvalid(
"gauss_seidel_NR_preare", 1, 4, 4, 1); __PYX_ERR(0, 165, __pyx_L3_error)
4807 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tol)) != 0)) kw_args--;
4809 __Pyx_RaiseArgtupleInvalid(
"gauss_seidel_NR_preare", 1, 4, 4, 2); __PYX_ERR(0, 165, __pyx_L3_error)
4813 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_M)) != 0)) kw_args--;
4815 __Pyx_RaiseArgtupleInvalid(
"gauss_seidel_NR_preare", 1, 4, 4, 3); __PYX_ERR(0, 165, __pyx_L3_error)
4818 if (unlikely(kw_args > 0)) {
4819 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"gauss_seidel_NR_preare") < 0)) __PYX_ERR(0, 165, __pyx_L3_error)
4821 }
else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
4822 goto __pyx_L5_argtuple_error;
4824 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4825 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4826 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4827 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4829 __pyx_v_A = values[0];
4830 __pyx_v_w = values[1];
4831 __pyx_v_tol = values[2];
4832 __pyx_v_M = values[3];
4834 goto __pyx_L4_argument_unpacking_done;
4835 __pyx_L5_argtuple_error:;
4836 __Pyx_RaiseArgtupleInvalid(
"gauss_seidel_NR_preare", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 165, __pyx_L3_error)
4838 __Pyx_AddTraceback(
"csmoothers.gauss_seidel_NR_preare", __pyx_clineno, __pyx_lineno, __pyx_filename);
4839 __Pyx_RefNannyFinishContext();
4841 __pyx_L4_argument_unpacking_done:;
4842 __pyx_r = __pyx_pf_10csmoothers_6gauss_seidel_NR_preare(__pyx_self, __pyx_v_A, __pyx_v_w, __pyx_v_tol, __pyx_v_M);
4845 __Pyx_RefNannyFinishContext();
4849 static PyObject *__pyx_pf_10csmoothers_6gauss_seidel_NR_preare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_w, PyObject *__pyx_v_tol, PyObject *__pyx_v_M) {
4850 PyObject *__pyx_r = NULL;
4851 __Pyx_RefNannyDeclarations
4852 PyObject *__pyx_t_1 = NULL;
4855 __pyx_t_10csmoothers_DDATA __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
4856 int __pyx_lineno = 0;
4857 const char *__pyx_filename = NULL;
4858 int __pyx_clineno = 0;
4859 __Pyx_RefNannySetupContext(
"gauss_seidel_NR_preare", 0);
4868 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_cSparseMatrix);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 175, __pyx_L1_error)
4869 __Pyx_GOTREF(__pyx_t_1);
4870 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 175, __pyx_L1_error)
4871 __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_w);
if (unlikely((__pyx_t_2 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 175, __pyx_L1_error)
4872 __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_v_tol);
if (unlikely((__pyx_t_3 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 175, __pyx_L1_error)
4873 __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_M, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(0, 175, __pyx_L1_error)
4874 __pyx_f_10csmoothers_smootherWrappersgauss_seidel_NR_prepare(((
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), __pyx_t_2, __pyx_t_3, __pyx_t_4);
4875 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4876 __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
4877 __pyx_t_4.memview = NULL;
4878 __pyx_t_4.data = NULL;
4889 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4892 __Pyx_XDECREF(__pyx_t_1);
4893 __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
4894 __Pyx_AddTraceback(
"csmoothers.gauss_seidel_NR_preare", __pyx_clineno, __pyx_lineno, __pyx_filename);
4897 __Pyx_XGIVEREF(__pyx_r);
4898 __Pyx_RefNannyFinishContext();
4910 static void __pyx_f_10csmoothers_smootherWrappersgauss_seidel_NR_prepare(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm,
double __pyx_v_w,
double __pyx_v_tol, __pyx_t_10csmoothers_DDATA __pyx_v_M) {
4911 __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
4912 __Pyx_RefNannyDeclarations
4913 PyObject *__pyx_t_1 = NULL;
4915 Py_ssize_t __pyx_t_3;
4916 int __pyx_lineno = 0;
4917 const char *__pyx_filename = NULL;
4918 int __pyx_clineno = 0;
4919 __Pyx_RefNannySetupContext(
"smootherWrappersgauss_seidel_NR_prepare", 0);
4928 __pyx_v_AS.Stype = SLU_NR;
4937 __pyx_v_AS.Dtype = SLU_D;
4946 __pyx_v_AS.Mtype = SLU_GE;
4955 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nr);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 185, __pyx_L1_error)
4956 __Pyx_GOTREF(__pyx_t_1);
4957 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 185, __pyx_L1_error)
4958 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4959 __pyx_v_AS.nrow = __pyx_t_2;
4968 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nc);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 186, __pyx_L1_error)
4969 __Pyx_GOTREF(__pyx_t_1);
4970 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 186, __pyx_L1_error)
4971 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4972 __pyx_v_AS.ncol = __pyx_t_2;
4981 __pyx_v_AS.Store = (&__pyx_v_sm->A);
4992 if (__pyx_t_3 < 0) {
4993 __pyx_t_3 += __pyx_v_M.shape[0];
4994 if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
4995 }
else if (unlikely(__pyx_t_3 >= __pyx_v_M.shape[0])) __pyx_t_2 = 0;
4996 if (unlikely(__pyx_t_2 != -1)) {
4997 __Pyx_RaiseBufferIndexError(__pyx_t_2);
4998 __PYX_ERR(0, 188, __pyx_L1_error)
5000 gauss_seidel_NR_prepare((&__pyx_v_AS), __pyx_v_w, __pyx_v_tol, (&(*((
double *) ( (__pyx_v_M.data + __pyx_t_3 * __pyx_v_M.strides[0]) )))));
5013 __Pyx_XDECREF(__pyx_t_1);
5014 __Pyx_WriteUnraisable(
"csmoothers.smootherWrappersgauss_seidel_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
5016 __Pyx_RefNannyFinishContext();
5028 static PyObject *__pyx_pw_10csmoothers_9gauss_seidel_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
5029 static char __pyx_doc_10csmoothers_8gauss_seidel_NR_solve[] =
"\n\n Arguments\n ---------\n A : superluWrappers.SparseMatrix\n M : np.array double\n R : np.array double\n node_order : np.array int\n dX : np.array double\n ";
5030 static PyMethodDef __pyx_mdef_10csmoothers_9gauss_seidel_NR_solve = {
"gauss_seidel_NR_solve", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_10csmoothers_9gauss_seidel_NR_solve, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10csmoothers_8gauss_seidel_NR_solve};
5031 static PyObject *__pyx_pw_10csmoothers_9gauss_seidel_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5032 PyObject *__pyx_v_A = 0;
5033 PyObject *__pyx_v_M = 0;
5034 PyObject *__pyx_v_R = 0;
5035 PyObject *__pyx_v_node_order = 0;
5036 PyObject *__pyx_v_dX = 0;
5037 int __pyx_lineno = 0;
5038 const char *__pyx_filename = NULL;
5039 int __pyx_clineno = 0;
5040 PyObject *__pyx_r = 0;
5041 __Pyx_RefNannyDeclarations
5042 __Pyx_RefNannySetupContext(
"gauss_seidel_NR_solve (wrapper)", 0);
5044 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_M,&__pyx_n_s_R,&__pyx_n_s_node_order,&__pyx_n_s_dX,0};
5045 PyObject* values[5] = {0,0,0,0,0};
5046 if (unlikely(__pyx_kwds)) {
5048 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5050 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5052 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5054 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5056 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5058 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5061 default:
goto __pyx_L5_argtuple_error;
5063 kw_args = PyDict_Size(__pyx_kwds);
5066 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
5067 else goto __pyx_L5_argtuple_error;
5070 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_M)) != 0)) kw_args--;
5072 __Pyx_RaiseArgtupleInvalid(
"gauss_seidel_NR_solve", 1, 5, 5, 1); __PYX_ERR(0, 190, __pyx_L3_error)
5076 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_R)) != 0)) kw_args--;
5078 __Pyx_RaiseArgtupleInvalid(
"gauss_seidel_NR_solve", 1, 5, 5, 2); __PYX_ERR(0, 190, __pyx_L3_error)
5082 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_node_order)) != 0)) kw_args--;
5084 __Pyx_RaiseArgtupleInvalid(
"gauss_seidel_NR_solve", 1, 5, 5, 3); __PYX_ERR(0, 190, __pyx_L3_error)
5088 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dX)) != 0)) kw_args--;
5090 __Pyx_RaiseArgtupleInvalid(
"gauss_seidel_NR_solve", 1, 5, 5, 4); __PYX_ERR(0, 190, __pyx_L3_error)
5093 if (unlikely(kw_args > 0)) {
5094 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"gauss_seidel_NR_solve") < 0)) __PYX_ERR(0, 190, __pyx_L3_error)
5096 }
else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
5097 goto __pyx_L5_argtuple_error;
5099 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5100 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5101 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5102 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5103 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5105 __pyx_v_A = values[0];
5106 __pyx_v_M = values[1];
5107 __pyx_v_R = values[2];
5108 __pyx_v_node_order = values[3];
5109 __pyx_v_dX = values[4];
5111 goto __pyx_L4_argument_unpacking_done;
5112 __pyx_L5_argtuple_error:;
5113 __Pyx_RaiseArgtupleInvalid(
"gauss_seidel_NR_solve", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 190, __pyx_L3_error)
5115 __Pyx_AddTraceback(
"csmoothers.gauss_seidel_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
5116 __Pyx_RefNannyFinishContext();
5118 __pyx_L4_argument_unpacking_done:;
5119 __pyx_r = __pyx_pf_10csmoothers_8gauss_seidel_NR_solve(__pyx_self, __pyx_v_A, __pyx_v_M, __pyx_v_R, __pyx_v_node_order, __pyx_v_dX);
5122 __Pyx_RefNannyFinishContext();
5126 static PyObject *__pyx_pf_10csmoothers_8gauss_seidel_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_M, PyObject *__pyx_v_R, PyObject *__pyx_v_node_order, PyObject *__pyx_v_dX) {
5127 PyObject *__pyx_r = NULL;
5128 __Pyx_RefNannyDeclarations
5129 PyObject *__pyx_t_1 = NULL;
5130 __pyx_t_10csmoothers_DDATA __pyx_t_2 = { 0, 0, { 0 }, { 0 }, { 0 } };
5131 __pyx_t_10csmoothers_DDATA __pyx_t_3 = { 0, 0, { 0 }, { 0 }, { 0 } };
5132 __pyx_t_10csmoothers_IDATA __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
5133 __pyx_t_10csmoothers_DDATA __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
5134 int __pyx_lineno = 0;
5135 const char *__pyx_filename = NULL;
5136 int __pyx_clineno = 0;
5137 __Pyx_RefNannySetupContext(
"gauss_seidel_NR_solve", 0);
5146 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_cSparseMatrix);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 201, __pyx_L1_error)
5147 __Pyx_GOTREF(__pyx_t_1);
5148 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 201, __pyx_L1_error)
5149 __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_M, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(0, 201, __pyx_L1_error)
5150 __pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_R, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 201, __pyx_L1_error)
5151 __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_node_order, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(0, 201, __pyx_L1_error)
5152 __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_dX, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 201, __pyx_L1_error)
5153 __pyx_f_10csmoothers_smootherWrappersgauss_seidel_NR_solve(((
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5);
5154 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5155 __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
5156 __pyx_t_2.memview = NULL;
5157 __pyx_t_2.data = NULL;
5158 __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
5159 __pyx_t_3.memview = NULL;
5160 __pyx_t_3.data = NULL;
5161 __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
5162 __pyx_t_4.memview = NULL;
5163 __pyx_t_4.data = NULL;
5164 __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
5165 __pyx_t_5.memview = NULL;
5166 __pyx_t_5.data = NULL;
5177 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5180 __Pyx_XDECREF(__pyx_t_1);
5181 __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
5182 __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
5183 __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
5184 __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
5185 __Pyx_AddTraceback(
"csmoothers.gauss_seidel_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
5188 __Pyx_XGIVEREF(__pyx_r);
5189 __Pyx_RefNannyFinishContext();
5201 static void __pyx_f_10csmoothers_smootherWrappersgauss_seidel_NR_solve(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm, __pyx_t_10csmoothers_DDATA __pyx_v_M, __pyx_t_10csmoothers_DDATA __pyx_v_R, __pyx_t_10csmoothers_IDATA __pyx_v_node_order, __pyx_t_10csmoothers_DDATA __pyx_v_dX) {
5202 __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
5203 __Pyx_RefNannyDeclarations
5204 PyObject *__pyx_t_1 = NULL;
5206 Py_ssize_t __pyx_t_3;
5207 Py_ssize_t __pyx_t_4;
5208 Py_ssize_t __pyx_t_5;
5209 Py_ssize_t __pyx_t_6;
5210 int __pyx_lineno = 0;
5211 const char *__pyx_filename = NULL;
5212 int __pyx_clineno = 0;
5213 __Pyx_RefNannySetupContext(
"smootherWrappersgauss_seidel_NR_solve", 0);
5222 __pyx_v_AS.Stype = SLU_NR;
5231 __pyx_v_AS.Dtype = SLU_D;
5240 __pyx_v_AS.Mtype = SLU_GE;
5249 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nr);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 212, __pyx_L1_error)
5250 __Pyx_GOTREF(__pyx_t_1);
5251 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 212, __pyx_L1_error)
5252 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5253 __pyx_v_AS.nrow = __pyx_t_2;
5262 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nc);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 213, __pyx_L1_error)
5263 __Pyx_GOTREF(__pyx_t_1);
5264 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 213, __pyx_L1_error)
5265 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5266 __pyx_v_AS.ncol = __pyx_t_2;
5275 __pyx_v_AS.Store = (&__pyx_v_sm->A);
5286 if (__pyx_t_3 < 0) {
5287 __pyx_t_3 += __pyx_v_M.shape[0];
5288 if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
5289 }
else if (unlikely(__pyx_t_3 >= __pyx_v_M.shape[0])) __pyx_t_2 = 0;
5290 if (unlikely(__pyx_t_2 != -1)) {
5291 __Pyx_RaiseBufferIndexError(__pyx_t_2);
5292 __PYX_ERR(0, 215, __pyx_L1_error)
5296 if (__pyx_t_4 < 0) {
5297 __pyx_t_4 += __pyx_v_R.shape[0];
5298 if (unlikely(__pyx_t_4 < 0)) __pyx_t_2 = 0;
5299 }
else if (unlikely(__pyx_t_4 >= __pyx_v_R.shape[0])) __pyx_t_2 = 0;
5300 if (unlikely(__pyx_t_2 != -1)) {
5301 __Pyx_RaiseBufferIndexError(__pyx_t_2);
5302 __PYX_ERR(0, 215, __pyx_L1_error)
5306 if (__pyx_t_5 < 0) {
5307 __pyx_t_5 += __pyx_v_node_order.shape[0];
5308 if (unlikely(__pyx_t_5 < 0)) __pyx_t_2 = 0;
5309 }
else if (unlikely(__pyx_t_5 >= __pyx_v_node_order.shape[0])) __pyx_t_2 = 0;
5310 if (unlikely(__pyx_t_2 != -1)) {
5311 __Pyx_RaiseBufferIndexError(__pyx_t_2);
5312 __PYX_ERR(0, 215, __pyx_L1_error)
5316 if (__pyx_t_6 < 0) {
5317 __pyx_t_6 += __pyx_v_dX.shape[0];
5318 if (unlikely(__pyx_t_6 < 0)) __pyx_t_2 = 0;
5319 }
else if (unlikely(__pyx_t_6 >= __pyx_v_dX.shape[0])) __pyx_t_2 = 0;
5320 if (unlikely(__pyx_t_2 != -1)) {
5321 __Pyx_RaiseBufferIndexError(__pyx_t_2);
5322 __PYX_ERR(0, 215, __pyx_L1_error)
5324 gauss_seidel_NR_solve((&__pyx_v_AS), (&(*((
double *) ( (__pyx_v_M.data + __pyx_t_3 * __pyx_v_M.strides[0]) )))), (&(*((
double *) ( (__pyx_v_R.data + __pyx_t_4 * __pyx_v_R.strides[0]) )))), (&(*((
int *) ( (__pyx_v_node_order.data + __pyx_t_5 * __pyx_v_node_order.strides[0]) )))), (&(*((
double *) ( (__pyx_v_dX.data + __pyx_t_6 * __pyx_v_dX.strides[0]) )))));
5337 __Pyx_XDECREF(__pyx_t_1);
5338 __Pyx_WriteUnraisable(
"csmoothers.smootherWrappersgauss_seidel_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
5340 __Pyx_RefNannyFinishContext();
5352 static PyObject *__pyx_pw_10csmoothers_11nl_gauss_seidel_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
5353 static char __pyx_doc_10csmoothers_10nl_gauss_seidel_NR_solve[] =
"\n \n Arguments\n ---------\n A : superluWrappers.SparseMatrix\n R : np.array double\n node_order : np.array int\n w : double\n tol : double\n dX : np.array double\n ";
5354 static PyMethodDef __pyx_mdef_10csmoothers_11nl_gauss_seidel_NR_solve = {
"nl_gauss_seidel_NR_solve", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_10csmoothers_11nl_gauss_seidel_NR_solve, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10csmoothers_10nl_gauss_seidel_NR_solve};
5355 static PyObject *__pyx_pw_10csmoothers_11nl_gauss_seidel_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5356 PyObject *__pyx_v_A = 0;
5357 PyObject *__pyx_v_R = 0;
5358 PyObject *__pyx_v_node_order = 0;
5359 PyObject *__pyx_v_w = 0;
5360 PyObject *__pyx_v_tol = 0;
5361 PyObject *__pyx_v_dX = 0;
5362 int __pyx_lineno = 0;
5363 const char *__pyx_filename = NULL;
5364 int __pyx_clineno = 0;
5365 PyObject *__pyx_r = 0;
5366 __Pyx_RefNannyDeclarations
5367 __Pyx_RefNannySetupContext(
"nl_gauss_seidel_NR_solve (wrapper)", 0);
5369 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_R,&__pyx_n_s_node_order,&__pyx_n_s_w,&__pyx_n_s_tol,&__pyx_n_s_dX,0};
5370 PyObject* values[6] = {0,0,0,0,0,0};
5371 if (unlikely(__pyx_kwds)) {
5373 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5375 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
5377 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5379 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5381 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5383 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5385 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5388 default:
goto __pyx_L5_argtuple_error;
5390 kw_args = PyDict_Size(__pyx_kwds);
5393 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
5394 else goto __pyx_L5_argtuple_error;
5397 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_R)) != 0)) kw_args--;
5399 __Pyx_RaiseArgtupleInvalid(
"nl_gauss_seidel_NR_solve", 1, 6, 6, 1); __PYX_ERR(0, 217, __pyx_L3_error)
5403 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_node_order)) != 0)) kw_args--;
5405 __Pyx_RaiseArgtupleInvalid(
"nl_gauss_seidel_NR_solve", 1, 6, 6, 2); __PYX_ERR(0, 217, __pyx_L3_error)
5409 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_w)) != 0)) kw_args--;
5411 __Pyx_RaiseArgtupleInvalid(
"nl_gauss_seidel_NR_solve", 1, 6, 6, 3); __PYX_ERR(0, 217, __pyx_L3_error)
5415 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tol)) != 0)) kw_args--;
5417 __Pyx_RaiseArgtupleInvalid(
"nl_gauss_seidel_NR_solve", 1, 6, 6, 4); __PYX_ERR(0, 217, __pyx_L3_error)
5421 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dX)) != 0)) kw_args--;
5423 __Pyx_RaiseArgtupleInvalid(
"nl_gauss_seidel_NR_solve", 1, 6, 6, 5); __PYX_ERR(0, 217, __pyx_L3_error)
5426 if (unlikely(kw_args > 0)) {
5427 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"nl_gauss_seidel_NR_solve") < 0)) __PYX_ERR(0, 217, __pyx_L3_error)
5429 }
else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
5430 goto __pyx_L5_argtuple_error;
5432 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5433 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5434 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5435 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5436 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5437 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
5439 __pyx_v_A = values[0];
5440 __pyx_v_R = values[1];
5441 __pyx_v_node_order = values[2];
5442 __pyx_v_w = values[3];
5443 __pyx_v_tol = values[4];
5444 __pyx_v_dX = values[5];
5446 goto __pyx_L4_argument_unpacking_done;
5447 __pyx_L5_argtuple_error:;
5448 __Pyx_RaiseArgtupleInvalid(
"nl_gauss_seidel_NR_solve", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 217, __pyx_L3_error)
5450 __Pyx_AddTraceback(
"csmoothers.nl_gauss_seidel_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
5451 __Pyx_RefNannyFinishContext();
5453 __pyx_L4_argument_unpacking_done:;
5454 __pyx_r = __pyx_pf_10csmoothers_10nl_gauss_seidel_NR_solve(__pyx_self, __pyx_v_A, __pyx_v_R, __pyx_v_node_order, __pyx_v_w, __pyx_v_tol, __pyx_v_dX);
5457 __Pyx_RefNannyFinishContext();
5461 static PyObject *__pyx_pf_10csmoothers_10nl_gauss_seidel_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_R, PyObject *__pyx_v_node_order, PyObject *__pyx_v_w, PyObject *__pyx_v_tol, PyObject *__pyx_v_dX) {
5462 PyObject *__pyx_r = NULL;
5463 __Pyx_RefNannyDeclarations
5464 PyObject *__pyx_t_1 = NULL;
5465 __pyx_t_10csmoothers_DDATA __pyx_t_2 = { 0, 0, { 0 }, { 0 }, { 0 } };
5466 __pyx_t_10csmoothers_IDATA __pyx_t_3 = { 0, 0, { 0 }, { 0 }, { 0 } };
5469 __pyx_t_10csmoothers_DDATA __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
5470 PyObject *__pyx_t_7 = NULL;
5471 int __pyx_lineno = 0;
5472 const char *__pyx_filename = NULL;
5473 int __pyx_clineno = 0;
5474 __Pyx_RefNannySetupContext(
"nl_gauss_seidel_NR_solve", 0);
5483 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_cSparseMatrix);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 229, __pyx_L1_error)
5484 __Pyx_GOTREF(__pyx_t_1);
5485 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 229, __pyx_L1_error)
5494 __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_R, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(0, 230, __pyx_L1_error)
5503 __pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_node_order, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 231, __pyx_L1_error)
5512 __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_v_w);
if (unlikely((__pyx_t_4 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 232, __pyx_L1_error)
5521 __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_v_tol);
if (unlikely((__pyx_t_5 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 233, __pyx_L1_error)
5530 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_dX, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 234, __pyx_L1_error)
5539 __pyx_t_7 = __pyx_f_10csmoothers_smootherWrappers_nl_gauss_seidel_NR_solve(((
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 229, __pyx_L1_error)
5540 __Pyx_GOTREF(__pyx_t_7);
5541 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5542 __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
5543 __pyx_t_2.memview = NULL;
5544 __pyx_t_2.data = NULL;
5545 __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
5546 __pyx_t_3.memview = NULL;
5547 __pyx_t_3.data = NULL;
5548 __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
5549 __pyx_t_6.memview = NULL;
5550 __pyx_t_6.data = NULL;
5551 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5562 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5565 __Pyx_XDECREF(__pyx_t_1);
5566 __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
5567 __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
5568 __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
5569 __Pyx_XDECREF(__pyx_t_7);
5570 __Pyx_AddTraceback(
"csmoothers.nl_gauss_seidel_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
5573 __Pyx_XGIVEREF(__pyx_r);
5574 __Pyx_RefNannyFinishContext();
5586 static PyObject *__pyx_f_10csmoothers_smootherWrappers_nl_gauss_seidel_NR_solve(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm, __pyx_t_10csmoothers_DDATA __pyx_v_R, __pyx_t_10csmoothers_IDATA __pyx_v_node_order,
double __pyx_v_w,
double __pyx_v_tol, __pyx_t_10csmoothers_DDATA __pyx_v_dX) {
5587 __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
5588 PyObject *__pyx_r = NULL;
5589 __Pyx_RefNannyDeclarations
5590 PyObject *__pyx_t_1 = NULL;
5592 Py_ssize_t __pyx_t_3;
5593 Py_ssize_t __pyx_t_4;
5594 Py_ssize_t __pyx_t_5;
5595 int __pyx_lineno = 0;
5596 const char *__pyx_filename = NULL;
5597 int __pyx_clineno = 0;
5598 __Pyx_RefNannySetupContext(
"smootherWrappers_nl_gauss_seidel_NR_solve", 0);
5607 __pyx_v_AS.Stype = SLU_NR;
5616 __pyx_v_AS.Dtype = SLU_D;
5625 __pyx_v_AS.Mtype = SLU_GE;
5634 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nr);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 246, __pyx_L1_error)
5635 __Pyx_GOTREF(__pyx_t_1);
5636 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 246, __pyx_L1_error)
5637 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5638 __pyx_v_AS.nrow = __pyx_t_2;
5647 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nc);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 247, __pyx_L1_error)
5648 __Pyx_GOTREF(__pyx_t_1);
5649 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 247, __pyx_L1_error)
5650 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5651 __pyx_v_AS.ncol = __pyx_t_2;
5660 __pyx_v_AS.Store = (&__pyx_v_sm->A);
5671 if (__pyx_t_3 < 0) {
5672 __pyx_t_3 += __pyx_v_R.shape[0];
5673 if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
5674 }
else if (unlikely(__pyx_t_3 >= __pyx_v_R.shape[0])) __pyx_t_2 = 0;
5675 if (unlikely(__pyx_t_2 != -1)) {
5676 __Pyx_RaiseBufferIndexError(__pyx_t_2);
5677 __PYX_ERR(0, 249, __pyx_L1_error)
5681 if (__pyx_t_4 < 0) {
5682 __pyx_t_4 += __pyx_v_node_order.shape[0];
5683 if (unlikely(__pyx_t_4 < 0)) __pyx_t_2 = 0;
5684 }
else if (unlikely(__pyx_t_4 >= __pyx_v_node_order.shape[0])) __pyx_t_2 = 0;
5685 if (unlikely(__pyx_t_2 != -1)) {
5686 __Pyx_RaiseBufferIndexError(__pyx_t_2);
5687 __PYX_ERR(0, 249, __pyx_L1_error)
5691 if (__pyx_t_5 < 0) {
5692 __pyx_t_5 += __pyx_v_dX.shape[0];
5693 if (unlikely(__pyx_t_5 < 0)) __pyx_t_2 = 0;
5694 }
else if (unlikely(__pyx_t_5 >= __pyx_v_dX.shape[0])) __pyx_t_2 = 0;
5695 if (unlikely(__pyx_t_2 != -1)) {
5696 __Pyx_RaiseBufferIndexError(__pyx_t_2);
5697 __PYX_ERR(0, 249, __pyx_L1_error)
5699 nl_gauss_seidel_NR_solve((&__pyx_v_AS), (&(*((
double *) ( (__pyx_v_R.data + __pyx_t_3 * __pyx_v_R.strides[0]) )))), (&(*((
int *) ( (__pyx_v_node_order.data + __pyx_t_4 * __pyx_v_node_order.strides[0]) )))), __pyx_v_w, __pyx_v_tol, (&(*((
double *) ( (__pyx_v_dX.data + __pyx_t_5 * __pyx_v_dX.strides[0]) )))));
5710 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5713 __Pyx_XDECREF(__pyx_t_1);
5714 __Pyx_AddTraceback(
"csmoothers.smootherWrappers_nl_gauss_seidel_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
5717 __Pyx_XGIVEREF(__pyx_r);
5718 __Pyx_RefNannyFinishContext();
5731 static PyObject *__pyx_pw_10csmoothers_13asm_NR_prepare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
5732 static char __pyx_doc_10csmoothers_12asm_NR_prepare[] =
"\n\n Arguments\n ---------\n A :\n asmFactor :\n ";
5733 static PyMethodDef __pyx_mdef_10csmoothers_13asm_NR_prepare = {
"asm_NR_prepare", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_10csmoothers_13asm_NR_prepare, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10csmoothers_12asm_NR_prepare};
5734 static PyObject *__pyx_pw_10csmoothers_13asm_NR_prepare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5735 PyObject *__pyx_v_A = 0;
5736 PyObject *__pyx_v_asmFactor = 0;
5737 int __pyx_lineno = 0;
5738 const char *__pyx_filename = NULL;
5739 int __pyx_clineno = 0;
5740 PyObject *__pyx_r = 0;
5741 __Pyx_RefNannyDeclarations
5742 __Pyx_RefNannySetupContext(
"asm_NR_prepare (wrapper)", 0);
5744 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_asmFactor,0};
5745 PyObject* values[2] = {0,0};
5746 if (unlikely(__pyx_kwds)) {
5748 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5750 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5752 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5755 default:
goto __pyx_L5_argtuple_error;
5757 kw_args = PyDict_Size(__pyx_kwds);
5760 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
5761 else goto __pyx_L5_argtuple_error;
5764 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_asmFactor)) != 0)) kw_args--;
5766 __Pyx_RaiseArgtupleInvalid(
"asm_NR_prepare", 1, 2, 2, 1); __PYX_ERR(0, 251, __pyx_L3_error)
5769 if (unlikely(kw_args > 0)) {
5770 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"asm_NR_prepare") < 0)) __PYX_ERR(0, 251, __pyx_L3_error)
5772 }
else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
5773 goto __pyx_L5_argtuple_error;
5775 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5776 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5778 __pyx_v_A = values[0];
5779 __pyx_v_asmFactor = values[1];
5781 goto __pyx_L4_argument_unpacking_done;
5782 __pyx_L5_argtuple_error:;
5783 __Pyx_RaiseArgtupleInvalid(
"asm_NR_prepare", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 251, __pyx_L3_error)
5785 __Pyx_AddTraceback(
"csmoothers.asm_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
5786 __Pyx_RefNannyFinishContext();
5788 __pyx_L4_argument_unpacking_done:;
5789 __pyx_r = __pyx_pf_10csmoothers_12asm_NR_prepare(__pyx_self, __pyx_v_A, __pyx_v_asmFactor);
5792 __Pyx_RefNannyFinishContext();
5796 static PyObject *__pyx_pf_10csmoothers_12asm_NR_prepare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_asmFactor) {
5797 PyObject *__pyx_r = NULL;
5798 __Pyx_RefNannyDeclarations
5799 PyObject *__pyx_t_1 = NULL;
5800 PyObject *__pyx_t_2 = NULL;
5801 int __pyx_lineno = 0;
5802 const char *__pyx_filename = NULL;
5803 int __pyx_clineno = 0;
5804 __Pyx_RefNannySetupContext(
"asm_NR_prepare", 0);
5813 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_cSparseMatrix);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 259, __pyx_L1_error)
5814 __Pyx_GOTREF(__pyx_t_1);
5815 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 259, __pyx_L1_error)
5824 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_asmFactor, __pyx_n_s_cASMFactor);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 260, __pyx_L1_error)
5825 __Pyx_GOTREF(__pyx_t_2);
5826 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10csmoothers_cASMFactor))))) __PYX_ERR(0, 260, __pyx_L1_error)
5835 __pyx_f_10csmoothers_smootherWrappers_asm_NR_prepare(((
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), ((
struct __pyx_obj_10csmoothers_cASMFactor *)__pyx_t_2));
5836 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5837 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5848 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5851 __Pyx_XDECREF(__pyx_t_1);
5852 __Pyx_XDECREF(__pyx_t_2);
5853 __Pyx_AddTraceback(
"csmoothers.asm_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
5856 __Pyx_XGIVEREF(__pyx_r);
5857 __Pyx_RefNannyFinishContext();
5869 static void __pyx_f_10csmoothers_smootherWrappers_asm_NR_prepare(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm,
struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_asmFactor) {
5870 __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
5871 __Pyx_RefNannyDeclarations
5872 PyObject *__pyx_t_1 = NULL;
5874 int __pyx_lineno = 0;
5875 const char *__pyx_filename = NULL;
5876 int __pyx_clineno = 0;
5877 __Pyx_RefNannySetupContext(
"smootherWrappers_asm_NR_prepare", 0);
5886 __pyx_v_AS.Stype = SLU_NR;
5895 __pyx_v_AS.Dtype = SLU_D;
5904 __pyx_v_AS.Mtype = SLU_GE;
5913 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nr);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 268, __pyx_L1_error)
5914 __Pyx_GOTREF(__pyx_t_1);
5915 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 268, __pyx_L1_error)
5916 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5917 __pyx_v_AS.nrow = __pyx_t_2;
5926 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nc);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 269, __pyx_L1_error)
5927 __Pyx_GOTREF(__pyx_t_1);
5928 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 269, __pyx_L1_error)
5929 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5930 __pyx_v_AS.ncol = __pyx_t_2;
5939 __pyx_v_AS.Store = (&__pyx_v_sm->A);
5948 asm_NR_prepare((&__pyx_v_AS), __pyx_v_asmFactor->subdomain_dim, __pyx_v_asmFactor->l2g_L, __pyx_v_asmFactor->subdomain_L, __pyx_v_asmFactor->subdomain_pivots);
5961 __Pyx_XDECREF(__pyx_t_1);
5962 __Pyx_WriteUnraisable(
"csmoothers.smootherWrappers_asm_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
5964 __Pyx_RefNannyFinishContext();
5976 static PyObject *__pyx_pw_10csmoothers_15asm_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
5977 static char __pyx_doc_10csmoothers_14asm_NR_solve[] =
"\n \n Arguments\n ---------\n A : superluWrappers.sparseMatrix\n w : double\n asmFactor : csmoothers.asmFactor\n node_order : np.array int\n R : np.array double\n dX : np.array double\n ";
5978 static PyMethodDef __pyx_mdef_10csmoothers_15asm_NR_solve = {
"asm_NR_solve", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_10csmoothers_15asm_NR_solve, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10csmoothers_14asm_NR_solve};
5979 static PyObject *__pyx_pw_10csmoothers_15asm_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5980 PyObject *__pyx_v_A = 0;
5981 PyObject *__pyx_v_w = 0;
5982 PyObject *__pyx_v_asmFactor = 0;
5983 PyObject *__pyx_v_node_order = 0;
5984 PyObject *__pyx_v_R = 0;
5985 PyObject *__pyx_v_dX = 0;
5986 int __pyx_lineno = 0;
5987 const char *__pyx_filename = NULL;
5988 int __pyx_clineno = 0;
5989 PyObject *__pyx_r = 0;
5990 __Pyx_RefNannyDeclarations
5991 __Pyx_RefNannySetupContext(
"asm_NR_solve (wrapper)", 0);
5993 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_w,&__pyx_n_s_asmFactor,&__pyx_n_s_node_order,&__pyx_n_s_R,&__pyx_n_s_dX,0};
5994 PyObject* values[6] = {0,0,0,0,0,0};
5995 if (unlikely(__pyx_kwds)) {
5997 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5999 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
6001 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6003 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6005 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6007 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6009 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6012 default:
goto __pyx_L5_argtuple_error;
6014 kw_args = PyDict_Size(__pyx_kwds);
6017 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
6018 else goto __pyx_L5_argtuple_error;
6021 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_w)) != 0)) kw_args--;
6023 __Pyx_RaiseArgtupleInvalid(
"asm_NR_solve", 1, 6, 6, 1); __PYX_ERR(0, 277, __pyx_L3_error)
6027 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_asmFactor)) != 0)) kw_args--;
6029 __Pyx_RaiseArgtupleInvalid(
"asm_NR_solve", 1, 6, 6, 2); __PYX_ERR(0, 277, __pyx_L3_error)
6033 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_node_order)) != 0)) kw_args--;
6035 __Pyx_RaiseArgtupleInvalid(
"asm_NR_solve", 1, 6, 6, 3); __PYX_ERR(0, 277, __pyx_L3_error)
6039 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_R)) != 0)) kw_args--;
6041 __Pyx_RaiseArgtupleInvalid(
"asm_NR_solve", 1, 6, 6, 4); __PYX_ERR(0, 277, __pyx_L3_error)
6045 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dX)) != 0)) kw_args--;
6047 __Pyx_RaiseArgtupleInvalid(
"asm_NR_solve", 1, 6, 6, 5); __PYX_ERR(0, 277, __pyx_L3_error)
6050 if (unlikely(kw_args > 0)) {
6051 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"asm_NR_solve") < 0)) __PYX_ERR(0, 277, __pyx_L3_error)
6053 }
else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
6054 goto __pyx_L5_argtuple_error;
6056 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6057 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6058 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6059 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6060 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6061 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
6063 __pyx_v_A = values[0];
6064 __pyx_v_w = values[1];
6065 __pyx_v_asmFactor = values[2];
6066 __pyx_v_node_order = values[3];
6067 __pyx_v_R = values[4];
6068 __pyx_v_dX = values[5];
6070 goto __pyx_L4_argument_unpacking_done;
6071 __pyx_L5_argtuple_error:;
6072 __Pyx_RaiseArgtupleInvalid(
"asm_NR_solve", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 277, __pyx_L3_error)
6074 __Pyx_AddTraceback(
"csmoothers.asm_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
6075 __Pyx_RefNannyFinishContext();
6077 __pyx_L4_argument_unpacking_done:;
6078 __pyx_r = __pyx_pf_10csmoothers_14asm_NR_solve(__pyx_self, __pyx_v_A, __pyx_v_w, __pyx_v_asmFactor, __pyx_v_node_order, __pyx_v_R, __pyx_v_dX);
6081 __Pyx_RefNannyFinishContext();
6085 static PyObject *__pyx_pf_10csmoothers_14asm_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_w, PyObject *__pyx_v_asmFactor, PyObject *__pyx_v_node_order, PyObject *__pyx_v_R, PyObject *__pyx_v_dX) {
6086 PyObject *__pyx_r = NULL;
6087 __Pyx_RefNannyDeclarations
6088 PyObject *__pyx_t_1 = NULL;
6090 PyObject *__pyx_t_3 = NULL;
6091 __pyx_t_10csmoothers_IDATA __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
6092 __pyx_t_10csmoothers_DDATA __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
6093 __pyx_t_10csmoothers_DDATA __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
6094 int __pyx_lineno = 0;
6095 const char *__pyx_filename = NULL;
6096 int __pyx_clineno = 0;
6097 __Pyx_RefNannySetupContext(
"asm_NR_solve", 0);
6106 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_cSparseMatrix);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 289, __pyx_L1_error)
6107 __Pyx_GOTREF(__pyx_t_1);
6108 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 289, __pyx_L1_error)
6117 __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_w);
if (unlikely((__pyx_t_2 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 290, __pyx_L1_error)
6126 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_asmFactor, __pyx_n_s_cASMFactor);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 291, __pyx_L1_error)
6127 __Pyx_GOTREF(__pyx_t_3);
6128 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_10csmoothers_cASMFactor))))) __PYX_ERR(0, 291, __pyx_L1_error)
6137 __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_node_order, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(0, 292, __pyx_L1_error)
6146 __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_R, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 293, __pyx_L1_error)
6155 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_dX, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 294, __pyx_L1_error)
6164 __pyx_f_10csmoothers_smootherWrappers_asm_NR_solve(((
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), __pyx_t_2, ((
struct __pyx_obj_10csmoothers_cASMFactor *)__pyx_t_3), __pyx_t_4, __pyx_t_5, __pyx_t_6);
6165 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6166 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6167 __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
6168 __pyx_t_4.memview = NULL;
6169 __pyx_t_4.data = NULL;
6170 __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
6171 __pyx_t_5.memview = NULL;
6172 __pyx_t_5.data = NULL;
6173 __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
6174 __pyx_t_6.memview = NULL;
6175 __pyx_t_6.data = NULL;
6186 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6189 __Pyx_XDECREF(__pyx_t_1);
6190 __Pyx_XDECREF(__pyx_t_3);
6191 __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
6192 __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
6193 __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
6194 __Pyx_AddTraceback(
"csmoothers.asm_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
6197 __Pyx_XGIVEREF(__pyx_r);
6198 __Pyx_RefNannyFinishContext();
6210 static void __pyx_f_10csmoothers_smootherWrappers_asm_NR_solve(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm,
double __pyx_v_w,
struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_asmFactor, __pyx_t_10csmoothers_IDATA __pyx_v_node_order, __pyx_t_10csmoothers_DDATA __pyx_v_R, __pyx_t_10csmoothers_DDATA __pyx_v_dX) {
6211 __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
6212 __Pyx_RefNannyDeclarations
6213 PyObject *__pyx_t_1 = NULL;
6215 Py_ssize_t __pyx_t_3;
6216 Py_ssize_t __pyx_t_4;
6217 Py_ssize_t __pyx_t_5;
6218 int __pyx_lineno = 0;
6219 const char *__pyx_filename = NULL;
6220 int __pyx_clineno = 0;
6221 __Pyx_RefNannySetupContext(
"smootherWrappers_asm_NR_solve", 0);
6230 __pyx_v_AS.Stype = SLU_NR;
6239 __pyx_v_AS.Dtype = SLU_D;
6248 __pyx_v_AS.Mtype = SLU_GE;
6257 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nr);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 306, __pyx_L1_error)
6258 __Pyx_GOTREF(__pyx_t_1);
6259 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 306, __pyx_L1_error)
6260 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6261 __pyx_v_AS.nrow = __pyx_t_2;
6270 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nc);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 307, __pyx_L1_error)
6271 __Pyx_GOTREF(__pyx_t_1);
6272 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 307, __pyx_L1_error)
6273 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6274 __pyx_v_AS.ncol = __pyx_t_2;
6283 __pyx_v_AS.Store = (&__pyx_v_sm->A);
6294 if (__pyx_t_3 < 0) {
6295 __pyx_t_3 += __pyx_v_R.shape[0];
6296 if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
6297 }
else if (unlikely(__pyx_t_3 >= __pyx_v_R.shape[0])) __pyx_t_2 = 0;
6298 if (unlikely(__pyx_t_2 != -1)) {
6299 __Pyx_RaiseBufferIndexError(__pyx_t_2);
6300 __PYX_ERR(0, 314, __pyx_L1_error)
6312 if (__pyx_t_4 < 0) {
6313 __pyx_t_4 += __pyx_v_node_order.shape[0];
6314 if (unlikely(__pyx_t_4 < 0)) __pyx_t_2 = 0;
6315 }
else if (unlikely(__pyx_t_4 >= __pyx_v_node_order.shape[0])) __pyx_t_2 = 0;
6316 if (unlikely(__pyx_t_2 != -1)) {
6317 __Pyx_RaiseBufferIndexError(__pyx_t_2);
6318 __PYX_ERR(0, 316, __pyx_L1_error)
6330 if (__pyx_t_5 < 0) {
6331 __pyx_t_5 += __pyx_v_dX.shape[0];
6332 if (unlikely(__pyx_t_5 < 0)) __pyx_t_2 = 0;
6333 }
else if (unlikely(__pyx_t_5 >= __pyx_v_dX.shape[0])) __pyx_t_2 = 0;
6334 if (unlikely(__pyx_t_2 != -1)) {
6335 __Pyx_RaiseBufferIndexError(__pyx_t_2);
6336 __PYX_ERR(0, 318, __pyx_L1_error)
6346 asm_NR_solve((&__pyx_v_AS), __pyx_v_w, __pyx_v_asmFactor->subdomain_L, __pyx_v_asmFactor->subdomain_dim, __pyx_v_asmFactor->l2g_L, (&(*((
double *) ( (__pyx_v_R.data + __pyx_t_3 * __pyx_v_R.strides[0]) )))), __pyx_v_asmFactor->subdomain_R, (&(*((
int *) ( (__pyx_v_node_order.data + __pyx_t_4 * __pyx_v_node_order.strides[0]) )))), __pyx_v_asmFactor->subdomain_dX, (&(*((
double *) ( (__pyx_v_dX.data + __pyx_t_5 * __pyx_v_dX.strides[0]) )))), __pyx_v_asmFactor->subdomain_pivots);
6359 __Pyx_XDECREF(__pyx_t_1);
6360 __Pyx_WriteUnraisable(
"csmoothers.smootherWrappers_asm_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
6362 __Pyx_RefNannyFinishContext();
6374 static PyObject *__pyx_pw_10csmoothers_17basm_NR_prepare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
6375 static char __pyx_doc_10csmoothers_16basm_NR_prepare[] =
"\n\n Arguments\n ---------\n A :\n basmFactor :\n ";
6376 static PyMethodDef __pyx_mdef_10csmoothers_17basm_NR_prepare = {
"basm_NR_prepare", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_10csmoothers_17basm_NR_prepare, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10csmoothers_16basm_NR_prepare};
6377 static PyObject *__pyx_pw_10csmoothers_17basm_NR_prepare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6378 PyObject *__pyx_v_A = 0;
6379 PyObject *__pyx_v_basmFactor = 0;
6380 int __pyx_lineno = 0;
6381 const char *__pyx_filename = NULL;
6382 int __pyx_clineno = 0;
6383 PyObject *__pyx_r = 0;
6384 __Pyx_RefNannyDeclarations
6385 __Pyx_RefNannySetupContext(
"basm_NR_prepare (wrapper)", 0);
6387 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_basmFactor,0};
6388 PyObject* values[2] = {0,0};
6389 if (unlikely(__pyx_kwds)) {
6391 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6393 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6395 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6398 default:
goto __pyx_L5_argtuple_error;
6400 kw_args = PyDict_Size(__pyx_kwds);
6403 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
6404 else goto __pyx_L5_argtuple_error;
6407 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_basmFactor)) != 0)) kw_args--;
6409 __Pyx_RaiseArgtupleInvalid(
"basm_NR_prepare", 1, 2, 2, 1); __PYX_ERR(0, 321, __pyx_L3_error)
6412 if (unlikely(kw_args > 0)) {
6413 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"basm_NR_prepare") < 0)) __PYX_ERR(0, 321, __pyx_L3_error)
6415 }
else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
6416 goto __pyx_L5_argtuple_error;
6418 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6419 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6421 __pyx_v_A = values[0];
6422 __pyx_v_basmFactor = values[1];
6424 goto __pyx_L4_argument_unpacking_done;
6425 __pyx_L5_argtuple_error:;
6426 __Pyx_RaiseArgtupleInvalid(
"basm_NR_prepare", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 321, __pyx_L3_error)
6428 __Pyx_AddTraceback(
"csmoothers.basm_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
6429 __Pyx_RefNannyFinishContext();
6431 __pyx_L4_argument_unpacking_done:;
6432 __pyx_r = __pyx_pf_10csmoothers_16basm_NR_prepare(__pyx_self, __pyx_v_A, __pyx_v_basmFactor);
6435 __Pyx_RefNannyFinishContext();
6439 static PyObject *__pyx_pf_10csmoothers_16basm_NR_prepare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_basmFactor) {
6440 PyObject *__pyx_r = NULL;
6441 __Pyx_RefNannyDeclarations
6442 PyObject *__pyx_t_1 = NULL;
6443 PyObject *__pyx_t_2 = NULL;
6444 int __pyx_lineno = 0;
6445 const char *__pyx_filename = NULL;
6446 int __pyx_clineno = 0;
6447 __Pyx_RefNannySetupContext(
"basm_NR_prepare", 0);
6456 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_cSparseMatrix);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 329, __pyx_L1_error)
6457 __Pyx_GOTREF(__pyx_t_1);
6458 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 329, __pyx_L1_error)
6467 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_basmFactor, __pyx_n_s_cBASMFactor);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 330, __pyx_L1_error)
6468 __Pyx_GOTREF(__pyx_t_2);
6469 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10csmoothers_cBASMFactor))))) __PYX_ERR(0, 330, __pyx_L1_error)
6478 __pyx_f_10csmoothers_smootherWrappers_basm_NR_prepare(((
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), ((
struct __pyx_obj_10csmoothers_cBASMFactor *)__pyx_t_2));
6479 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6480 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6491 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6494 __Pyx_XDECREF(__pyx_t_1);
6495 __Pyx_XDECREF(__pyx_t_2);
6496 __Pyx_AddTraceback(
"csmoothers.basm_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
6499 __Pyx_XGIVEREF(__pyx_r);
6500 __Pyx_RefNannyFinishContext();
6512 static void __pyx_f_10csmoothers_smootherWrappers_basm_NR_prepare(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm,
struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_basmFactor) {
6513 __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
6514 __Pyx_RefNannyDeclarations
6515 PyObject *__pyx_t_1 = NULL;
6517 int __pyx_lineno = 0;
6518 const char *__pyx_filename = NULL;
6519 int __pyx_clineno = 0;
6520 __Pyx_RefNannySetupContext(
"smootherWrappers_basm_NR_prepare", 0);
6529 __pyx_v_AS.Dtype = SLU_D;
6538 __pyx_v_AS.Mtype = SLU_GE;
6547 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nr);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 337, __pyx_L1_error)
6548 __Pyx_GOTREF(__pyx_t_1);
6549 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 337, __pyx_L1_error)
6550 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6551 __pyx_v_AS.nrow = __pyx_t_2;
6560 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nc);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 338, __pyx_L1_error)
6561 __Pyx_GOTREF(__pyx_t_1);
6562 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 338, __pyx_L1_error)
6563 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6564 __pyx_v_AS.ncol = __pyx_t_2;
6573 __pyx_v_AS.Store = (&__pyx_v_sm->A);
6582 basm_NR_prepare(__pyx_v_basmFactor->bs, __pyx_v_basmFactor->N, (&__pyx_v_AS), __pyx_v_basmFactor->subdomain_dim, __pyx_v_basmFactor->l2g_L, __pyx_v_basmFactor->subdomain_L, __pyx_v_basmFactor->subdomain_pivots, __pyx_v_basmFactor->subdomain_col_pivots);
6595 __Pyx_XDECREF(__pyx_t_1);
6596 __Pyx_WriteUnraisable(
"csmoothers.smootherWrappers_basm_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
6598 __Pyx_RefNannyFinishContext();
6610 static PyObject *__pyx_pw_10csmoothers_19basm_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
6611 static char __pyx_doc_10csmoothers_18basm_NR_solve[] =
"\n \n Arguments\n ---------\n A :\n w :\n basmFactor :\n node_order :\n R :\n dX :\n ";
6612 static PyMethodDef __pyx_mdef_10csmoothers_19basm_NR_solve = {
"basm_NR_solve", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_10csmoothers_19basm_NR_solve, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10csmoothers_18basm_NR_solve};
6613 static PyObject *__pyx_pw_10csmoothers_19basm_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6614 PyObject *__pyx_v_A = 0;
6615 PyObject *__pyx_v_w = 0;
6616 PyObject *__pyx_v_basmFactor = 0;
6617 PyObject *__pyx_v_node_order = 0;
6618 PyObject *__pyx_v_R = 0;
6619 PyObject *__pyx_v_dX = 0;
6620 int __pyx_lineno = 0;
6621 const char *__pyx_filename = NULL;
6622 int __pyx_clineno = 0;
6623 PyObject *__pyx_r = 0;
6624 __Pyx_RefNannyDeclarations
6625 __Pyx_RefNannySetupContext(
"basm_NR_solve (wrapper)", 0);
6627 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_w,&__pyx_n_s_basmFactor,&__pyx_n_s_node_order,&__pyx_n_s_R,&__pyx_n_s_dX,0};
6628 PyObject* values[6] = {0,0,0,0,0,0};
6629 if (unlikely(__pyx_kwds)) {
6631 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6633 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
6635 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6637 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6639 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6641 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6643 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6646 default:
goto __pyx_L5_argtuple_error;
6648 kw_args = PyDict_Size(__pyx_kwds);
6651 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
6652 else goto __pyx_L5_argtuple_error;
6655 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_w)) != 0)) kw_args--;
6657 __Pyx_RaiseArgtupleInvalid(
"basm_NR_solve", 1, 6, 6, 1); __PYX_ERR(0, 350, __pyx_L3_error)
6661 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_basmFactor)) != 0)) kw_args--;
6663 __Pyx_RaiseArgtupleInvalid(
"basm_NR_solve", 1, 6, 6, 2); __PYX_ERR(0, 350, __pyx_L3_error)
6667 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_node_order)) != 0)) kw_args--;
6669 __Pyx_RaiseArgtupleInvalid(
"basm_NR_solve", 1, 6, 6, 3); __PYX_ERR(0, 350, __pyx_L3_error)
6673 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_R)) != 0)) kw_args--;
6675 __Pyx_RaiseArgtupleInvalid(
"basm_NR_solve", 1, 6, 6, 4); __PYX_ERR(0, 350, __pyx_L3_error)
6679 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dX)) != 0)) kw_args--;
6681 __Pyx_RaiseArgtupleInvalid(
"basm_NR_solve", 1, 6, 6, 5); __PYX_ERR(0, 350, __pyx_L3_error)
6684 if (unlikely(kw_args > 0)) {
6685 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"basm_NR_solve") < 0)) __PYX_ERR(0, 350, __pyx_L3_error)
6687 }
else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
6688 goto __pyx_L5_argtuple_error;
6690 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6691 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6692 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6693 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6694 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6695 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
6697 __pyx_v_A = values[0];
6698 __pyx_v_w = values[1];
6699 __pyx_v_basmFactor = values[2];
6700 __pyx_v_node_order = values[3];
6701 __pyx_v_R = values[4];
6702 __pyx_v_dX = values[5];
6704 goto __pyx_L4_argument_unpacking_done;
6705 __pyx_L5_argtuple_error:;
6706 __Pyx_RaiseArgtupleInvalid(
"basm_NR_solve", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 350, __pyx_L3_error)
6708 __Pyx_AddTraceback(
"csmoothers.basm_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
6709 __Pyx_RefNannyFinishContext();
6711 __pyx_L4_argument_unpacking_done:;
6712 __pyx_r = __pyx_pf_10csmoothers_18basm_NR_solve(__pyx_self, __pyx_v_A, __pyx_v_w, __pyx_v_basmFactor, __pyx_v_node_order, __pyx_v_R, __pyx_v_dX);
6715 __Pyx_RefNannyFinishContext();
6719 static PyObject *__pyx_pf_10csmoothers_18basm_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_w, PyObject *__pyx_v_basmFactor, PyObject *__pyx_v_node_order, PyObject *__pyx_v_R, PyObject *__pyx_v_dX) {
6720 PyObject *__pyx_r = NULL;
6721 __Pyx_RefNannyDeclarations
6722 PyObject *__pyx_t_1 = NULL;
6724 PyObject *__pyx_t_3 = NULL;
6725 __pyx_t_10csmoothers_IDATA __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
6726 __pyx_t_10csmoothers_DDATA __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
6727 __pyx_t_10csmoothers_DDATA __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
6728 int __pyx_lineno = 0;
6729 const char *__pyx_filename = NULL;
6730 int __pyx_clineno = 0;
6731 __Pyx_RefNannySetupContext(
"basm_NR_solve", 0);
6740 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_cSparseMatrix);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 362, __pyx_L1_error)
6741 __Pyx_GOTREF(__pyx_t_1);
6742 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 362, __pyx_L1_error)
6751 __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_w);
if (unlikely((__pyx_t_2 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 363, __pyx_L1_error)
6760 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_basmFactor, __pyx_n_s_cBASMFactor);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 364, __pyx_L1_error)
6761 __Pyx_GOTREF(__pyx_t_3);
6762 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_10csmoothers_cBASMFactor))))) __PYX_ERR(0, 364, __pyx_L1_error)
6771 __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_node_order, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(0, 365, __pyx_L1_error)
6780 __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_R, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 366, __pyx_L1_error)
6789 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_dX, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 367, __pyx_L1_error)
6798 __pyx_f_10csmoothers_smootherWrappers_basm_NR_solve(((
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), __pyx_t_2, ((
struct __pyx_obj_10csmoothers_cBASMFactor *)__pyx_t_3), __pyx_t_4, __pyx_t_5, __pyx_t_6);
6799 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6800 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6801 __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
6802 __pyx_t_4.memview = NULL;
6803 __pyx_t_4.data = NULL;
6804 __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
6805 __pyx_t_5.memview = NULL;
6806 __pyx_t_5.data = NULL;
6807 __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
6808 __pyx_t_6.memview = NULL;
6809 __pyx_t_6.data = NULL;
6820 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6823 __Pyx_XDECREF(__pyx_t_1);
6824 __Pyx_XDECREF(__pyx_t_3);
6825 __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
6826 __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
6827 __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
6828 __Pyx_AddTraceback(
"csmoothers.basm_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
6831 __Pyx_XGIVEREF(__pyx_r);
6832 __Pyx_RefNannyFinishContext();
6844 static void __pyx_f_10csmoothers_smootherWrappers_basm_NR_solve(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm,
double __pyx_v_w,
struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_basmFactor, __pyx_t_10csmoothers_IDATA __pyx_v_node_order, __pyx_t_10csmoothers_DDATA __pyx_v_R, __pyx_t_10csmoothers_DDATA __pyx_v_dX) {
6845 __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
6846 __Pyx_RefNannyDeclarations
6847 PyObject *__pyx_t_1 = NULL;
6849 Py_ssize_t __pyx_t_3;
6850 Py_ssize_t __pyx_t_4;
6851 Py_ssize_t __pyx_t_5;
6852 int __pyx_lineno = 0;
6853 const char *__pyx_filename = NULL;
6854 int __pyx_clineno = 0;
6855 __Pyx_RefNannySetupContext(
"smootherWrappers_basm_NR_solve", 0);
6864 __pyx_v_AS.Stype = SLU_NR;
6873 __pyx_v_AS.Dtype = SLU_D;
6882 __pyx_v_AS.Mtype = SLU_GE;
6891 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nr);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 379, __pyx_L1_error)
6892 __Pyx_GOTREF(__pyx_t_1);
6893 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 379, __pyx_L1_error)
6894 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6895 __pyx_v_AS.nrow = __pyx_t_2;
6904 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nc);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 380, __pyx_L1_error)
6905 __Pyx_GOTREF(__pyx_t_1);
6906 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 380, __pyx_L1_error)
6907 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6908 __pyx_v_AS.ncol = __pyx_t_2;
6917 __pyx_v_AS.Store = (&__pyx_v_sm->A);
6928 if (__pyx_t_3 < 0) {
6929 __pyx_t_3 += __pyx_v_R.shape[0];
6930 if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
6931 }
else if (unlikely(__pyx_t_3 >= __pyx_v_R.shape[0])) __pyx_t_2 = 0;
6932 if (unlikely(__pyx_t_2 != -1)) {
6933 __Pyx_RaiseBufferIndexError(__pyx_t_2);
6934 __PYX_ERR(0, 389, __pyx_L1_error)
6946 if (__pyx_t_4 < 0) {
6947 __pyx_t_4 += __pyx_v_node_order.shape[0];
6948 if (unlikely(__pyx_t_4 < 0)) __pyx_t_2 = 0;
6949 }
else if (unlikely(__pyx_t_4 >= __pyx_v_node_order.shape[0])) __pyx_t_2 = 0;
6950 if (unlikely(__pyx_t_2 != -1)) {
6951 __Pyx_RaiseBufferIndexError(__pyx_t_2);
6952 __PYX_ERR(0, 391, __pyx_L1_error)
6964 if (__pyx_t_5 < 0) {
6965 __pyx_t_5 += __pyx_v_dX.shape[0];
6966 if (unlikely(__pyx_t_5 < 0)) __pyx_t_2 = 0;
6967 }
else if (unlikely(__pyx_t_5 >= __pyx_v_dX.shape[0])) __pyx_t_2 = 0;
6968 if (unlikely(__pyx_t_2 != -1)) {
6969 __Pyx_RaiseBufferIndexError(__pyx_t_2);
6970 __PYX_ERR(0, 393, __pyx_L1_error)
6980 basm_NR_solve(__pyx_v_basmFactor->bs, __pyx_v_basmFactor->N, (&__pyx_v_AS), __pyx_v_w, __pyx_v_basmFactor->subdomain_L, __pyx_v_basmFactor->subdomain_dim, __pyx_v_basmFactor->l2g_L, (&(*((
double *) ( (__pyx_v_R.data + __pyx_t_3 * __pyx_v_R.strides[0]) )))), __pyx_v_basmFactor->subdomain_R, (&(*((
int *) ( (__pyx_v_node_order.data + __pyx_t_4 * __pyx_v_node_order.strides[0]) )))), __pyx_v_basmFactor->subdomain_dX, (&(*((
double *) ( (__pyx_v_dX.data + __pyx_t_5 * __pyx_v_dX.strides[0]) )))), __pyx_v_basmFactor->subdomain_pivots, __pyx_v_basmFactor->subdomain_col_pivots);
6993 __Pyx_XDECREF(__pyx_t_1);
6994 __Pyx_WriteUnraisable(
"csmoothers.smootherWrappers_basm_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
6996 __Pyx_RefNannyFinishContext();
7007 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
7008 PyObject *__pyx_r = NULL;
7009 __Pyx_RefNannyDeclarations
7010 PyObject *__pyx_t_1 = NULL;
7011 int __pyx_lineno = 0;
7012 const char *__pyx_filename = NULL;
7013 int __pyx_clineno = 0;
7014 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew1", 0);
7023 __Pyx_XDECREF(__pyx_r);
7024 __pyx_t_1 = PyArray_MultiIterNew(1, ((
void *)__pyx_v_a));
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 743, __pyx_L1_error)
7025 __Pyx_GOTREF(__pyx_t_1);
7026 __pyx_r = __pyx_t_1;
7040 __Pyx_XDECREF(__pyx_t_1);
7041 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
7044 __Pyx_XGIVEREF(__pyx_r);
7045 __Pyx_RefNannyFinishContext();
7057 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
7058 PyObject *__pyx_r = NULL;
7059 __Pyx_RefNannyDeclarations
7060 PyObject *__pyx_t_1 = NULL;
7061 int __pyx_lineno = 0;
7062 const char *__pyx_filename = NULL;
7063 int __pyx_clineno = 0;
7064 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew2", 0);
7073 __Pyx_XDECREF(__pyx_r);
7074 __pyx_t_1 = PyArray_MultiIterNew(2, ((
void *)__pyx_v_a), ((
void *)__pyx_v_b));
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 746, __pyx_L1_error)
7075 __Pyx_GOTREF(__pyx_t_1);
7076 __pyx_r = __pyx_t_1;
7090 __Pyx_XDECREF(__pyx_t_1);
7091 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
7094 __Pyx_XGIVEREF(__pyx_r);
7095 __Pyx_RefNannyFinishContext();
7107 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
7108 PyObject *__pyx_r = NULL;
7109 __Pyx_RefNannyDeclarations
7110 PyObject *__pyx_t_1 = NULL;
7111 int __pyx_lineno = 0;
7112 const char *__pyx_filename = NULL;
7113 int __pyx_clineno = 0;
7114 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew3", 0);
7123 __Pyx_XDECREF(__pyx_r);
7124 __pyx_t_1 = PyArray_MultiIterNew(3, ((
void *)__pyx_v_a), ((
void *)__pyx_v_b), ((
void *)__pyx_v_c));
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 749, __pyx_L1_error)
7125 __Pyx_GOTREF(__pyx_t_1);
7126 __pyx_r = __pyx_t_1;
7140 __Pyx_XDECREF(__pyx_t_1);
7141 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
7144 __Pyx_XGIVEREF(__pyx_r);
7145 __Pyx_RefNannyFinishContext();
7157 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) {
7158 PyObject *__pyx_r = NULL;
7159 __Pyx_RefNannyDeclarations
7160 PyObject *__pyx_t_1 = NULL;
7161 int __pyx_lineno = 0;
7162 const char *__pyx_filename = NULL;
7163 int __pyx_clineno = 0;
7164 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew4", 0);
7173 __Pyx_XDECREF(__pyx_r);
7174 __pyx_t_1 = PyArray_MultiIterNew(4, ((
void *)__pyx_v_a), ((
void *)__pyx_v_b), ((
void *)__pyx_v_c), ((
void *)__pyx_v_d));
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 752, __pyx_L1_error)
7175 __Pyx_GOTREF(__pyx_t_1);
7176 __pyx_r = __pyx_t_1;
7190 __Pyx_XDECREF(__pyx_t_1);
7191 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
7194 __Pyx_XGIVEREF(__pyx_r);
7195 __Pyx_RefNannyFinishContext();
7207 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) {
7208 PyObject *__pyx_r = NULL;
7209 __Pyx_RefNannyDeclarations
7210 PyObject *__pyx_t_1 = NULL;
7211 int __pyx_lineno = 0;
7212 const char *__pyx_filename = NULL;
7213 int __pyx_clineno = 0;
7214 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew5", 0);
7223 __Pyx_XDECREF(__pyx_r);
7224 __pyx_t_1 = PyArray_MultiIterNew(5, ((
void *)__pyx_v_a), ((
void *)__pyx_v_b), ((
void *)__pyx_v_c), ((
void *)__pyx_v_d), ((
void *)__pyx_v_e));
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 755, __pyx_L1_error)
7225 __Pyx_GOTREF(__pyx_t_1);
7226 __pyx_r = __pyx_t_1;
7240 __Pyx_XDECREF(__pyx_t_1);
7241 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
7244 __Pyx_XGIVEREF(__pyx_r);
7245 __Pyx_RefNannyFinishContext();
7257 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
7258 PyObject *__pyx_r = NULL;
7259 __Pyx_RefNannyDeclarations
7261 __Pyx_RefNannySetupContext(
"PyDataType_SHAPE", 0);
7270 __pyx_t_1 = (PyDataType_HASSUBARRAY(__pyx_v_d) != 0);
7280 __Pyx_XDECREF(__pyx_r);
7281 __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape));
7282 __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape);
7302 __Pyx_XDECREF(__pyx_r);
7303 __Pyx_INCREF(__pyx_empty_tuple);
7304 __pyx_r = __pyx_empty_tuple;
7318 __Pyx_XGIVEREF(__pyx_r);
7319 __Pyx_RefNannyFinishContext();
7331 static CYTHON_INLINE
char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx_v_descr,
char *__pyx_v_f,
char *__pyx_v_end,
int *__pyx_v_offset) {
7332 PyArray_Descr *__pyx_v_child = 0;
7333 int __pyx_v_endian_detector;
7334 int __pyx_v_little_endian;
7335 PyObject *__pyx_v_fields = 0;
7336 PyObject *__pyx_v_childname = NULL;
7337 PyObject *__pyx_v_new_offset = NULL;
7338 PyObject *__pyx_v_t = NULL;
7340 __Pyx_RefNannyDeclarations
7341 PyObject *__pyx_t_1 = NULL;
7342 Py_ssize_t __pyx_t_2;
7343 PyObject *__pyx_t_3 = NULL;
7344 PyObject *__pyx_t_4 = NULL;
7350 int __pyx_lineno = 0;
7351 const char *__pyx_filename = NULL;
7352 int __pyx_clineno = 0;
7353 __Pyx_RefNannySetupContext(
"_util_dtypestring", 0);
7362 __pyx_v_endian_detector = 1;
7371 __pyx_v_little_endian = ((((
char *)(&__pyx_v_endian_detector))[0]) != 0);
7380 if (unlikely(__pyx_v_descr->names == Py_None)) {
7381 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not iterable");
7382 __PYX_ERR(2, 772, __pyx_L1_error)
7384 __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
7386 if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1))
break;
7387 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
7388 __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++;
if (unlikely(0 < 0)) __PYX_ERR(2, 772, __pyx_L1_error)
7390 __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++;
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 772, __pyx_L1_error)
7391 __Pyx_GOTREF(__pyx_t_3);
7393 __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3);
7403 if (unlikely(__pyx_v_descr->fields == Py_None)) {
7404 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
7405 __PYX_ERR(2, 773, __pyx_L1_error)
7407 __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 773, __pyx_L1_error)
7408 __Pyx_GOTREF(__pyx_t_3);
7409 if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(2, 773, __pyx_L1_error)
7410 __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3));
7420 if (likely(__pyx_v_fields != Py_None)) {
7421 PyObject* sequence = __pyx_v_fields;
7422 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
7423 if (unlikely(size != 2)) {
7424 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
7425 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
7426 __PYX_ERR(2, 774, __pyx_L1_error)
7428 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
7429 __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
7430 __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
7431 __Pyx_INCREF(__pyx_t_3);
7432 __Pyx_INCREF(__pyx_t_4);
7434 __pyx_t_3 = PySequence_ITEM(sequence, 0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 774, __pyx_L1_error)
7435 __Pyx_GOTREF(__pyx_t_3);
7436 __pyx_t_4 = PySequence_ITEM(sequence, 1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 774, __pyx_L1_error)
7437 __Pyx_GOTREF(__pyx_t_4);
7440 __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(2, 774, __pyx_L1_error)
7442 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(2, 774, __pyx_L1_error)
7443 __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3));
7445 __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4);
7455 __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0]));
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 776, __pyx_L1_error)
7456 __Pyx_GOTREF(__pyx_t_4);
7457 __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 776, __pyx_L1_error)
7458 __Pyx_GOTREF(__pyx_t_3);
7459 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7460 __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3);
if (unlikely((__pyx_t_5 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(2, 776, __pyx_L1_error)
7461 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7462 __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((
int)__pyx_t_5)) < 15) != 0);
7463 if (unlikely(__pyx_t_6)) {
7472 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__5, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 777, __pyx_L1_error)
7473 __Pyx_GOTREF(__pyx_t_3);
7474 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
7475 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7476 __PYX_ERR(2, 777, __pyx_L1_error)
7494 __pyx_t_7 = ((__pyx_v_child->byteorder ==
'>') != 0);
7496 goto __pyx_L8_next_or;
7499 __pyx_t_7 = (__pyx_v_little_endian != 0);
7502 __pyx_t_6 = __pyx_t_7;
7503 goto __pyx_L7_bool_binop_done;
7514 __pyx_t_7 = ((__pyx_v_child->byteorder ==
'<') != 0);
7517 __pyx_t_6 = __pyx_t_7;
7518 goto __pyx_L7_bool_binop_done;
7520 __pyx_t_7 = ((!(__pyx_v_little_endian != 0)) != 0);
7521 __pyx_t_6 = __pyx_t_7;
7522 __pyx_L7_bool_binop_done:;
7531 if (unlikely(__pyx_t_6)) {
7540 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__6, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 781, __pyx_L1_error)
7541 __Pyx_GOTREF(__pyx_t_3);
7542 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
7543 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7544 __PYX_ERR(2, 781, __pyx_L1_error)
7563 __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0]));
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 791, __pyx_L1_error)
7564 __Pyx_GOTREF(__pyx_t_3);
7565 __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 791, __pyx_L1_error)
7566 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7567 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 791, __pyx_L1_error)
7568 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7569 if (!__pyx_t_6)
break;
7578 (__pyx_v_f[0]) = 0x78;
7587 __pyx_v_f = (__pyx_v_f + 1);
7597 (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1);
7608 (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize);
7617 __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0);
7627 __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 799, __pyx_L1_error)
7628 __Pyx_GOTREF(__pyx_t_4);
7629 __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4);
7639 __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0);
7640 if (unlikely(__pyx_t_6)) {
7649 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__7, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 801, __pyx_L1_error)
7650 __Pyx_GOTREF(__pyx_t_4);
7651 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
7652 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7653 __PYX_ERR(2, 801, __pyx_L1_error)
7671 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 804, __pyx_L1_error)
7672 __Pyx_GOTREF(__pyx_t_4);
7673 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 804, __pyx_L1_error)
7674 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7675 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 804, __pyx_L1_error)
7676 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7678 (__pyx_v_f[0]) = 98;
7689 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 805, __pyx_L1_error)
7690 __Pyx_GOTREF(__pyx_t_3);
7691 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 805, __pyx_L1_error)
7692 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7693 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 805, __pyx_L1_error)
7694 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7696 (__pyx_v_f[0]) = 66;
7707 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 806, __pyx_L1_error)
7708 __Pyx_GOTREF(__pyx_t_4);
7709 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 806, __pyx_L1_error)
7710 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7711 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 806, __pyx_L1_error)
7712 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7714 (__pyx_v_f[0]) = 0x68;
7725 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 807, __pyx_L1_error)
7726 __Pyx_GOTREF(__pyx_t_3);
7727 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 807, __pyx_L1_error)
7728 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7729 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 807, __pyx_L1_error)
7730 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7732 (__pyx_v_f[0]) = 72;
7743 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 808, __pyx_L1_error)
7744 __Pyx_GOTREF(__pyx_t_4);
7745 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 808, __pyx_L1_error)
7746 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7747 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 808, __pyx_L1_error)
7748 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7750 (__pyx_v_f[0]) = 0x69;
7761 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 809, __pyx_L1_error)
7762 __Pyx_GOTREF(__pyx_t_3);
7763 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 809, __pyx_L1_error)
7764 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7765 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 809, __pyx_L1_error)
7766 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7768 (__pyx_v_f[0]) = 73;
7779 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 810, __pyx_L1_error)
7780 __Pyx_GOTREF(__pyx_t_4);
7781 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 810, __pyx_L1_error)
7782 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7783 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 810, __pyx_L1_error)
7784 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7786 (__pyx_v_f[0]) = 0x6C;
7797 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 811, __pyx_L1_error)
7798 __Pyx_GOTREF(__pyx_t_3);
7799 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 811, __pyx_L1_error)
7800 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7801 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 811, __pyx_L1_error)
7802 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7804 (__pyx_v_f[0]) = 76;
7815 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 812, __pyx_L1_error)
7816 __Pyx_GOTREF(__pyx_t_4);
7817 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 812, __pyx_L1_error)
7818 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7819 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 812, __pyx_L1_error)
7820 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7822 (__pyx_v_f[0]) = 0x71;
7833 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 813, __pyx_L1_error)
7834 __Pyx_GOTREF(__pyx_t_3);
7835 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 813, __pyx_L1_error)
7836 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7837 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 813, __pyx_L1_error)
7838 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7840 (__pyx_v_f[0]) = 81;
7851 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 814, __pyx_L1_error)
7852 __Pyx_GOTREF(__pyx_t_4);
7853 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 814, __pyx_L1_error)
7854 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7855 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 814, __pyx_L1_error)
7856 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7858 (__pyx_v_f[0]) = 0x66;
7869 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 815, __pyx_L1_error)
7870 __Pyx_GOTREF(__pyx_t_3);
7871 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 815, __pyx_L1_error)
7872 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7873 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 815, __pyx_L1_error)
7874 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7876 (__pyx_v_f[0]) = 0x64;
7887 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 816, __pyx_L1_error)
7888 __Pyx_GOTREF(__pyx_t_4);
7889 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 816, __pyx_L1_error)
7890 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7891 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 816, __pyx_L1_error)
7892 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7894 (__pyx_v_f[0]) = 0x67;
7905 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 817, __pyx_L1_error)
7906 __Pyx_GOTREF(__pyx_t_3);
7907 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 817, __pyx_L1_error)
7908 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7909 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 817, __pyx_L1_error)
7910 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7912 (__pyx_v_f[0]) = 90;
7913 (__pyx_v_f[1]) = 0x66;
7914 __pyx_v_f = (__pyx_v_f + 1);
7925 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 818, __pyx_L1_error)
7926 __Pyx_GOTREF(__pyx_t_4);
7927 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 818, __pyx_L1_error)
7928 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7929 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 818, __pyx_L1_error)
7930 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7932 (__pyx_v_f[0]) = 90;
7933 (__pyx_v_f[1]) = 0x64;
7934 __pyx_v_f = (__pyx_v_f + 1);
7945 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 819, __pyx_L1_error)
7946 __Pyx_GOTREF(__pyx_t_3);
7947 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 819, __pyx_L1_error)
7948 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7949 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 819, __pyx_L1_error)
7950 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7952 (__pyx_v_f[0]) = 90;
7953 (__pyx_v_f[1]) = 0x67;
7954 __pyx_v_f = (__pyx_v_f + 1);
7965 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 820, __pyx_L1_error)
7966 __Pyx_GOTREF(__pyx_t_4);
7967 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 820, __pyx_L1_error)
7968 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7969 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 820, __pyx_L1_error)
7970 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7971 if (likely(__pyx_t_6)) {
7972 (__pyx_v_f[0]) = 79;
7984 __pyx_t_3 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 822, __pyx_L1_error)
7985 __Pyx_GOTREF(__pyx_t_3);
7986 __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 822, __pyx_L1_error)
7987 __Pyx_GOTREF(__pyx_t_4);
7988 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7989 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
7990 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7991 __PYX_ERR(2, 822, __pyx_L1_error)
8002 __pyx_v_f = (__pyx_v_f + 1);
8022 __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset);
if (unlikely(__pyx_t_9 == ((
char *)NULL))) __PYX_ERR(2, 827, __pyx_L1_error)
8023 __pyx_v_f = __pyx_t_9;
8035 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8044 __pyx_r = __pyx_v_f;
8057 __Pyx_XDECREF(__pyx_t_1);
8058 __Pyx_XDECREF(__pyx_t_3);
8059 __Pyx_XDECREF(__pyx_t_4);
8060 __Pyx_AddTraceback(
"numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename);
8063 __Pyx_XDECREF((PyObject *)__pyx_v_child);
8064 __Pyx_XDECREF(__pyx_v_fields);
8065 __Pyx_XDECREF(__pyx_v_childname);
8066 __Pyx_XDECREF(__pyx_v_new_offset);
8067 __Pyx_XDECREF(__pyx_v_t);
8068 __Pyx_RefNannyFinishContext();
8080 static CYTHON_INLINE
void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
8081 __Pyx_RefNannyDeclarations
8082 __Pyx_RefNannySetupContext(
"set_array_base", 0);
8091 Py_INCREF(__pyx_v_base);
8100 (void)(PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base));
8111 __Pyx_RefNannyFinishContext();
8122 static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
8123 PyObject *__pyx_v_base;
8124 PyObject *__pyx_r = NULL;
8125 __Pyx_RefNannyDeclarations
8127 __Pyx_RefNannySetupContext(
"get_array_base", 0);
8136 __pyx_v_base = PyArray_BASE(__pyx_v_arr);
8145 __pyx_t_1 = ((__pyx_v_base == NULL) != 0);
8155 __Pyx_XDECREF(__pyx_r);
8156 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
8175 __Pyx_XDECREF(__pyx_r);
8176 __Pyx_INCREF(((PyObject *)__pyx_v_base));
8177 __pyx_r = ((PyObject *)__pyx_v_base);
8190 __Pyx_XGIVEREF(__pyx_r);
8191 __Pyx_RefNannyFinishContext();
8203 static CYTHON_INLINE
int __pyx_f_5numpy_import_array(
void) {
8205 __Pyx_RefNannyDeclarations
8206 PyObject *__pyx_t_1 = NULL;
8207 PyObject *__pyx_t_2 = NULL;
8208 PyObject *__pyx_t_3 = NULL;
8210 PyObject *__pyx_t_5 = NULL;
8211 PyObject *__pyx_t_6 = NULL;
8212 PyObject *__pyx_t_7 = NULL;
8213 PyObject *__pyx_t_8 = NULL;
8214 int __pyx_lineno = 0;
8215 const char *__pyx_filename = NULL;
8216 int __pyx_clineno = 0;
8217 __Pyx_RefNannySetupContext(
"import_array", 0);
8227 __Pyx_PyThreadState_declare
8228 __Pyx_PyThreadState_assign
8229 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
8230 __Pyx_XGOTREF(__pyx_t_1);
8231 __Pyx_XGOTREF(__pyx_t_2);
8232 __Pyx_XGOTREF(__pyx_t_3);
8242 __pyx_t_4 = _import_array();
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(2, 957, __pyx_L3_error)
8252 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
8253 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
8254 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
8255 goto __pyx_L8_try_end;
8265 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
8267 __Pyx_AddTraceback(
"numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
8268 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 958, __pyx_L5_except_error)
8269 __Pyx_GOTREF(__pyx_t_5);
8270 __Pyx_GOTREF(__pyx_t_6);
8271 __Pyx_GOTREF(__pyx_t_7);
8280 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__8, NULL);
if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 959, __pyx_L5_except_error)
8281 __Pyx_GOTREF(__pyx_t_8);
8282 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
8283 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8284 __PYX_ERR(2, 959, __pyx_L5_except_error)
8286 goto __pyx_L5_except_error;
8287 __pyx_L5_except_error:;
8296 __Pyx_XGIVEREF(__pyx_t_1);
8297 __Pyx_XGIVEREF(__pyx_t_2);
8298 __Pyx_XGIVEREF(__pyx_t_3);
8299 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
8300 goto __pyx_L1_error;
8316 __Pyx_XDECREF(__pyx_t_5);
8317 __Pyx_XDECREF(__pyx_t_6);
8318 __Pyx_XDECREF(__pyx_t_7);
8319 __Pyx_XDECREF(__pyx_t_8);
8320 __Pyx_AddTraceback(
"numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
8323 __Pyx_RefNannyFinishContext();
8335 static CYTHON_INLINE
int __pyx_f_5numpy_import_umath(
void) {
8337 __Pyx_RefNannyDeclarations
8338 PyObject *__pyx_t_1 = NULL;
8339 PyObject *__pyx_t_2 = NULL;
8340 PyObject *__pyx_t_3 = NULL;
8342 PyObject *__pyx_t_5 = NULL;
8343 PyObject *__pyx_t_6 = NULL;
8344 PyObject *__pyx_t_7 = NULL;
8345 PyObject *__pyx_t_8 = NULL;
8346 int __pyx_lineno = 0;
8347 const char *__pyx_filename = NULL;
8348 int __pyx_clineno = 0;
8349 __Pyx_RefNannySetupContext(
"import_umath", 0);
8359 __Pyx_PyThreadState_declare
8360 __Pyx_PyThreadState_assign
8361 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
8362 __Pyx_XGOTREF(__pyx_t_1);
8363 __Pyx_XGOTREF(__pyx_t_2);
8364 __Pyx_XGOTREF(__pyx_t_3);
8374 __pyx_t_4 = _import_umath();
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(2, 963, __pyx_L3_error)
8384 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
8385 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
8386 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
8387 goto __pyx_L8_try_end;
8397 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
8399 __Pyx_AddTraceback(
"numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
8400 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 964, __pyx_L5_except_error)
8401 __Pyx_GOTREF(__pyx_t_5);
8402 __Pyx_GOTREF(__pyx_t_6);
8403 __Pyx_GOTREF(__pyx_t_7);
8412 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__9, NULL);
if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 965, __pyx_L5_except_error)
8413 __Pyx_GOTREF(__pyx_t_8);
8414 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
8415 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8416 __PYX_ERR(2, 965, __pyx_L5_except_error)
8418 goto __pyx_L5_except_error;
8419 __pyx_L5_except_error:;
8428 __Pyx_XGIVEREF(__pyx_t_1);
8429 __Pyx_XGIVEREF(__pyx_t_2);
8430 __Pyx_XGIVEREF(__pyx_t_3);
8431 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
8432 goto __pyx_L1_error;
8448 __Pyx_XDECREF(__pyx_t_5);
8449 __Pyx_XDECREF(__pyx_t_6);
8450 __Pyx_XDECREF(__pyx_t_7);
8451 __Pyx_XDECREF(__pyx_t_8);
8452 __Pyx_AddTraceback(
"numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
8455 __Pyx_RefNannyFinishContext();
8467 static CYTHON_INLINE
int __pyx_f_5numpy_import_ufunc(
void) {
8469 __Pyx_RefNannyDeclarations
8470 PyObject *__pyx_t_1 = NULL;
8471 PyObject *__pyx_t_2 = NULL;
8472 PyObject *__pyx_t_3 = NULL;
8474 PyObject *__pyx_t_5 = NULL;
8475 PyObject *__pyx_t_6 = NULL;
8476 PyObject *__pyx_t_7 = NULL;
8477 PyObject *__pyx_t_8 = NULL;
8478 int __pyx_lineno = 0;
8479 const char *__pyx_filename = NULL;
8480 int __pyx_clineno = 0;
8481 __Pyx_RefNannySetupContext(
"import_ufunc", 0);
8491 __Pyx_PyThreadState_declare
8492 __Pyx_PyThreadState_assign
8493 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
8494 __Pyx_XGOTREF(__pyx_t_1);
8495 __Pyx_XGOTREF(__pyx_t_2);
8496 __Pyx_XGOTREF(__pyx_t_3);
8506 __pyx_t_4 = _import_umath();
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(2, 969, __pyx_L3_error)
8516 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
8517 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
8518 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
8519 goto __pyx_L8_try_end;
8529 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
8531 __Pyx_AddTraceback(
"numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
8532 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 970, __pyx_L5_except_error)
8533 __Pyx_GOTREF(__pyx_t_5);
8534 __Pyx_GOTREF(__pyx_t_6);
8535 __Pyx_GOTREF(__pyx_t_7);
8544 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__9, NULL);
if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 971, __pyx_L5_except_error)
8545 __Pyx_GOTREF(__pyx_t_8);
8546 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
8547 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8548 __PYX_ERR(2, 971, __pyx_L5_except_error)
8550 goto __pyx_L5_except_error;
8551 __pyx_L5_except_error:;
8560 __Pyx_XGIVEREF(__pyx_t_1);
8561 __Pyx_XGIVEREF(__pyx_t_2);
8562 __Pyx_XGIVEREF(__pyx_t_3);
8563 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
8564 goto __pyx_L1_error;
8580 __Pyx_XDECREF(__pyx_t_5);
8581 __Pyx_XDECREF(__pyx_t_6);
8582 __Pyx_XDECREF(__pyx_t_7);
8583 __Pyx_XDECREF(__pyx_t_8);
8584 __Pyx_AddTraceback(
"numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
8587 __Pyx_RefNannyFinishContext();
8600 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
8601 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
8602 PyObject *__pyx_v_shape = 0;
8603 Py_ssize_t __pyx_v_itemsize;
8604 PyObject *__pyx_v_format = 0;
8605 PyObject *__pyx_v_mode = 0;
8606 int __pyx_v_allocate_buffer;
8607 int __pyx_lineno = 0;
8608 const char *__pyx_filename = NULL;
8609 int __pyx_clineno = 0;
8611 __Pyx_RefNannyDeclarations
8612 __Pyx_RefNannySetupContext(
"__cinit__ (wrapper)", 0);
8614 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_shape,&__pyx_n_s_itemsize,&__pyx_n_s_format,&__pyx_n_s_mode,&__pyx_n_s_allocate_buffer,0};
8615 PyObject* values[5] = {0,0,0,0,0};
8616 values[3] = ((PyObject *)__pyx_n_s_c);
8617 if (unlikely(__pyx_kwds)) {
8619 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
8621 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
8623 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
8625 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8627 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8629 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8632 default:
goto __pyx_L5_argtuple_error;
8634 kw_args = PyDict_Size(__pyx_kwds);
8637 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--;
8638 else goto __pyx_L5_argtuple_error;
8641 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--;
8643 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 3, 5, 1); __PYX_ERR(1, 122, __pyx_L3_error)
8647 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--;
8649 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 3, 5, 2); __PYX_ERR(1, 122, __pyx_L3_error)
8654 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
8655 if (value) { values[3] = value; kw_args--; }
8660 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_allocate_buffer);
8661 if (value) { values[4] = value; kw_args--; }
8664 if (unlikely(kw_args > 0)) {
8665 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__cinit__") < 0)) __PYX_ERR(1, 122, __pyx_L3_error)
8668 switch (PyTuple_GET_SIZE(__pyx_args)) {
8669 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
8671 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
8673 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8674 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8675 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8677 default:
goto __pyx_L5_argtuple_error;
8680 __pyx_v_shape = ((PyObject*)values[0]);
8681 __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]);
if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 122, __pyx_L3_error)
8682 __pyx_v_format = values[2];
8683 __pyx_v_mode = values[3];
8685 __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]);
if (unlikely((__pyx_v_allocate_buffer == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 123, __pyx_L3_error)
8695 __pyx_v_allocate_buffer = ((int)1);
8698 goto __pyx_L4_argument_unpacking_done;
8699 __pyx_L5_argtuple_error:;
8700 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 122, __pyx_L3_error)
8702 __Pyx_AddTraceback(
"View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8703 __Pyx_RefNannyFinishContext();
8705 __pyx_L4_argument_unpacking_done:;
8706 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1,
"shape", 1))) __PYX_ERR(1, 122, __pyx_L1_error)
8707 if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) {
8708 PyErr_Format(PyExc_TypeError,
"Argument '%.200s' must not be None",
"format"); __PYX_ERR(1, 122, __pyx_L1_error)
8710 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(((
struct __pyx_array_obj *)__pyx_v_self), __pyx_v_shape, __pyx_v_itemsize, __pyx_v_format, __pyx_v_mode, __pyx_v_allocate_buffer);
8725 __Pyx_RefNannyFinishContext();
8729 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode,
int __pyx_v_allocate_buffer) {
8731 Py_ssize_t __pyx_v_i;
8732 Py_ssize_t __pyx_v_dim;
8733 PyObject **__pyx_v_p;
8736 __Pyx_RefNannyDeclarations
8737 Py_ssize_t __pyx_t_1;
8739 PyObject *__pyx_t_3 = NULL;
8741 PyObject *__pyx_t_5 = NULL;
8742 PyObject *__pyx_t_6 = NULL;
8745 Py_ssize_t __pyx_t_9;
8746 PyObject *__pyx_t_10 = NULL;
8747 Py_ssize_t __pyx_t_11;
8748 int __pyx_lineno = 0;
8749 const char *__pyx_filename = NULL;
8750 int __pyx_clineno = 0;
8751 __Pyx_RefNannySetupContext(
"__cinit__", 0);
8752 __Pyx_INCREF(__pyx_v_format);
8761 if (unlikely(__pyx_v_shape == Py_None)) {
8762 PyErr_SetString(PyExc_TypeError,
"object of type 'NoneType' has no len()");
8763 __PYX_ERR(1, 129, __pyx_L1_error)
8765 __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape);
if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 129, __pyx_L1_error)
8766 __pyx_v_self->ndim = ((int)__pyx_t_1);
8775 __pyx_v_self->itemsize = __pyx_v_itemsize;
8784 __pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0);
8785 if (unlikely(__pyx_t_2)) {
8794 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__10, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 133, __pyx_L1_error)
8795 __Pyx_GOTREF(__pyx_t_3);
8796 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
8797 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8798 __PYX_ERR(1, 133, __pyx_L1_error)
8816 __pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0);
8817 if (unlikely(__pyx_t_2)) {
8826 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__11, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 136, __pyx_L1_error)
8827 __Pyx_GOTREF(__pyx_t_3);
8828 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
8829 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8830 __PYX_ERR(1, 136, __pyx_L1_error)
8848 __pyx_t_2 = PyBytes_Check(__pyx_v_format);
8849 __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0);
8859 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 139, __pyx_L1_error)
8860 __Pyx_GOTREF(__pyx_t_5);
8862 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
8863 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
8864 if (likely(__pyx_t_6)) {
8865 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_5);
8866 __Pyx_INCREF(__pyx_t_6);
8867 __Pyx_INCREF(
function);
8868 __Pyx_DECREF_SET(__pyx_t_5,
function);
8871 __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_n_s_ASCII) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_n_s_ASCII);
8872 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
8873 if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 139, __pyx_L1_error)
8874 __Pyx_GOTREF(__pyx_t_3);
8875 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8876 __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_3);
8895 if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"bytes", Py_TYPE(__pyx_v_format)->tp_name), 0))) __PYX_ERR(1, 140, __pyx_L1_error)
8896 __pyx_t_3 = __pyx_v_format;
8897 __Pyx_INCREF(__pyx_t_3);
8898 __Pyx_GIVEREF(__pyx_t_3);
8899 __Pyx_GOTREF(__pyx_v_self->_format);
8900 __Pyx_DECREF(__pyx_v_self->_format);
8901 __pyx_v_self->_format = ((PyObject*)__pyx_t_3);
8911 if (unlikely(__pyx_v_self->_format == Py_None)) {
8912 PyErr_SetString(PyExc_TypeError,
"expected bytes, NoneType found");
8913 __PYX_ERR(1, 141, __pyx_L1_error)
8915 __pyx_t_7 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_format);
if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(1, 141, __pyx_L1_error)
8916 __pyx_v_self->format = __pyx_t_7;
8925 __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((
sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2)));
8934 __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim);
8943 __pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0);
8944 if (unlikely(__pyx_t_4)) {
8953 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__12, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 148, __pyx_L1_error)
8954 __Pyx_GOTREF(__pyx_t_3);
8955 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
8956 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8957 __PYX_ERR(1, 148, __pyx_L1_error)
8976 __pyx_t_3 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = 0;
8978 if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3))
break;
8979 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8980 __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_5); __pyx_t_1++;
if (unlikely(0 < 0)) __PYX_ERR(1, 151, __pyx_L1_error)
8982 __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++;
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 151, __pyx_L1_error)
8983 __Pyx_GOTREF(__pyx_t_5);
8985 __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5);
if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 151, __pyx_L1_error)
8986 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8987 __pyx_v_dim = __pyx_t_9;
8988 __pyx_v_idx = __pyx_t_8;
8989 __pyx_t_8 = (__pyx_t_8 + 1);
8998 __pyx_t_4 = ((__pyx_v_dim <= 0) != 0);
8999 if (unlikely(__pyx_t_4)) {
9008 __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_idx);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 153, __pyx_L1_error)
9009 __Pyx_GOTREF(__pyx_t_5);
9010 __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_dim);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 153, __pyx_L1_error)
9011 __Pyx_GOTREF(__pyx_t_6);
9012 __pyx_t_10 = PyTuple_New(2);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 153, __pyx_L1_error)
9013 __Pyx_GOTREF(__pyx_t_10);
9014 __Pyx_GIVEREF(__pyx_t_5);
9015 PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5);
9016 __Pyx_GIVEREF(__pyx_t_6);
9017 PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_6);
9020 __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_t_10);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 153, __pyx_L1_error)
9021 __Pyx_GOTREF(__pyx_t_6);
9022 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
9023 __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 153, __pyx_L1_error)
9024 __Pyx_GOTREF(__pyx_t_10);
9025 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9026 __Pyx_Raise(__pyx_t_10, 0, 0, 0);
9027 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
9028 __PYX_ERR(1, 153, __pyx_L1_error)
9046 (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim;
9056 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9065 __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ));
if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 157, __pyx_L1_error)
9075 __pyx_v_order =
'F';
9084 __Pyx_INCREF(__pyx_n_u_fortran);
9085 __Pyx_GIVEREF(__pyx_n_u_fortran);
9086 __Pyx_GOTREF(__pyx_v_self->mode);
9087 __Pyx_DECREF(__pyx_v_self->mode);
9088 __pyx_v_self->mode = __pyx_n_u_fortran;
9107 __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ));
if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 160, __pyx_L1_error)
9108 if (likely(__pyx_t_4)) {
9117 __pyx_v_order =
'C';
9126 __Pyx_INCREF(__pyx_n_u_c);
9127 __Pyx_GIVEREF(__pyx_n_u_c);
9128 __Pyx_GOTREF(__pyx_v_self->mode);
9129 __Pyx_DECREF(__pyx_v_self->mode);
9130 __pyx_v_self->mode = __pyx_n_u_c;
9150 __pyx_t_3 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 164, __pyx_L1_error)
9151 __Pyx_GOTREF(__pyx_t_3);
9152 __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 164, __pyx_L1_error)
9153 __Pyx_GOTREF(__pyx_t_10);
9154 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9155 __Pyx_Raise(__pyx_t_10, 0, 0, 0);
9156 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
9157 __PYX_ERR(1, 164, __pyx_L1_error)
9168 __pyx_v_self->len = __pyx_fill_contig_strides_array(__pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_itemsize, __pyx_v_self->ndim, __pyx_v_order);
9177 __pyx_v_self->free_data = __pyx_v_allocate_buffer;
9186 __pyx_t_10 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_10);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 170, __pyx_L1_error)
9187 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10);
if (unlikely((__pyx_t_4 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 170, __pyx_L1_error)
9188 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
9189 __pyx_v_self->dtype_is_object = __pyx_t_4;
9198 __pyx_t_4 = (__pyx_v_allocate_buffer != 0);
9208 __pyx_v_self->data = ((
char *)malloc(__pyx_v_self->len));
9217 __pyx_t_4 = ((!(__pyx_v_self->data != 0)) != 0);
9218 if (unlikely(__pyx_t_4)) {
9227 __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__13, NULL);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 176, __pyx_L1_error)
9228 __Pyx_GOTREF(__pyx_t_10);
9229 __Pyx_Raise(__pyx_t_10, 0, 0, 0);
9230 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
9231 __PYX_ERR(1, 176, __pyx_L1_error)
9249 __pyx_t_4 = (__pyx_v_self->dtype_is_object != 0);
9259 __pyx_v_p = ((PyObject **)__pyx_v_self->data);
9268 if (unlikely(__pyx_v_itemsize == 0)) {
9269 PyErr_SetString(PyExc_ZeroDivisionError,
"integer division or modulo by zero");
9270 __PYX_ERR(1, 180, __pyx_L1_error)
9272 else if (
sizeof(Py_ssize_t) ==
sizeof(
long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_self->len))) {
9273 PyErr_SetString(PyExc_OverflowError,
"value too large to perform division");
9274 __PYX_ERR(1, 180, __pyx_L1_error)
9276 __pyx_t_1 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_itemsize);
9277 __pyx_t_9 = __pyx_t_1;
9278 for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) {
9279 __pyx_v_i = __pyx_t_11;
9288 (__pyx_v_p[__pyx_v_i]) = Py_None;
9330 __Pyx_XDECREF(__pyx_t_3);
9331 __Pyx_XDECREF(__pyx_t_5);
9332 __Pyx_XDECREF(__pyx_t_6);
9333 __Pyx_XDECREF(__pyx_t_10);
9334 __Pyx_AddTraceback(
"View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9337 __Pyx_XDECREF(__pyx_v_format);
9338 __Pyx_RefNannyFinishContext();
9351 static CYTHON_UNUSED
int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
9352 static CYTHON_UNUSED
int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
9354 __Pyx_RefNannyDeclarations
9355 __Pyx_RefNannySetupContext(
"__getbuffer__ (wrapper)", 0);
9356 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(((
struct __pyx_array_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((
int)__pyx_v_flags));
9359 __Pyx_RefNannyFinishContext();
9363 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(
struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
9364 int __pyx_v_bufmode;
9366 __Pyx_RefNannyDeclarations
9369 PyObject *__pyx_t_3 = NULL;
9371 Py_ssize_t __pyx_t_5;
9373 Py_ssize_t *__pyx_t_7;
9374 int __pyx_lineno = 0;
9375 const char *__pyx_filename = NULL;
9376 int __pyx_clineno = 0;
9377 if (__pyx_v_info == NULL) {
9378 PyErr_SetString(PyExc_BufferError,
"PyObject_GetBuffer: view==NULL argument is obsolete");
9381 __Pyx_RefNannySetupContext(
"__getbuffer__", 0);
9382 __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
9383 __Pyx_GIVEREF(__pyx_v_info->obj);
9392 __pyx_v_bufmode = -1;
9401 __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ));
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 187, __pyx_L1_error)
9402 __pyx_t_2 = (__pyx_t_1 != 0);
9412 __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
9431 __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ));
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 189, __pyx_L1_error)
9432 __pyx_t_1 = (__pyx_t_2 != 0);
9442 __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
9461 __pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0);
9462 if (unlikely(__pyx_t_1)) {
9471 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__14, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 192, __pyx_L1_error)
9472 __Pyx_GOTREF(__pyx_t_3);
9473 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
9474 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9475 __PYX_ERR(1, 192, __pyx_L1_error)
9493 __pyx_t_4 = __pyx_v_self->data;
9494 __pyx_v_info->buf = __pyx_t_4;
9503 __pyx_t_5 = __pyx_v_self->len;
9504 __pyx_v_info->len = __pyx_t_5;
9513 __pyx_t_6 = __pyx_v_self->ndim;
9514 __pyx_v_info->ndim = __pyx_t_6;
9523 __pyx_t_7 = __pyx_v_self->_shape;
9524 __pyx_v_info->shape = __pyx_t_7;
9533 __pyx_t_7 = __pyx_v_self->_strides;
9534 __pyx_v_info->strides = __pyx_t_7;
9543 __pyx_v_info->suboffsets = NULL;
9552 __pyx_t_5 = __pyx_v_self->itemsize;
9553 __pyx_v_info->itemsize = __pyx_t_5;
9562 __pyx_v_info->readonly = 0;
9571 __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
9581 __pyx_t_4 = __pyx_v_self->format;
9582 __pyx_v_info->format = __pyx_t_4;
9602 __pyx_v_info->format = NULL;
9613 __Pyx_INCREF(((PyObject *)__pyx_v_self));
9614 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
9615 __Pyx_GOTREF(__pyx_v_info->obj);
9616 __Pyx_DECREF(__pyx_v_info->obj);
9617 __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
9631 __Pyx_XDECREF(__pyx_t_3);
9632 __Pyx_AddTraceback(
"View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9634 if (__pyx_v_info->obj != NULL) {
9635 __Pyx_GOTREF(__pyx_v_info->obj);
9636 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
9640 if (__pyx_v_info->obj == Py_None) {
9641 __Pyx_GOTREF(__pyx_v_info->obj);
9642 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
9645 __Pyx_RefNannyFinishContext();
9658 static void __pyx_array___dealloc__(PyObject *__pyx_v_self);
9659 static void __pyx_array___dealloc__(PyObject *__pyx_v_self) {
9660 __Pyx_RefNannyDeclarations
9661 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
9662 __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(((
struct __pyx_array_obj *)__pyx_v_self));
9665 __Pyx_RefNannyFinishContext();
9668 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(
struct __pyx_array_obj *__pyx_v_self) {
9669 __Pyx_RefNannyDeclarations
9671 __Pyx_RefNannySetupContext(
"__dealloc__", 0);
9680 __pyx_t_1 = ((__pyx_v_self->callback_free_data != NULL) != 0);
9690 __pyx_v_self->callback_free_data(__pyx_v_self->data);
9709 __pyx_t_1 = (__pyx_v_self->free_data != 0);
9719 __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
9729 __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0);
9747 free(__pyx_v_self->data);
9766 PyObject_Free(__pyx_v_self->_shape);
9777 __Pyx_RefNannyFinishContext();
9789 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self);
9790 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self) {
9791 PyObject *__pyx_r = 0;
9792 __Pyx_RefNannyDeclarations
9793 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
9794 __pyx_r = __pyx_pf_15View_dot_MemoryView_5array_7memview___get__(((
struct __pyx_array_obj *)__pyx_v_self));
9797 __Pyx_RefNannyFinishContext();
9801 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(
struct __pyx_array_obj *__pyx_v_self) {
9802 PyObject *__pyx_r = NULL;
9803 __Pyx_RefNannyDeclarations
9804 PyObject *__pyx_t_1 = NULL;
9805 int __pyx_lineno = 0;
9806 const char *__pyx_filename = NULL;
9807 int __pyx_clineno = 0;
9808 __Pyx_RefNannySetupContext(
"__get__", 0);
9817 __Pyx_XDECREF(__pyx_r);
9818 __pyx_t_1 = ((
struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 223, __pyx_L1_error)
9819 __Pyx_GOTREF(__pyx_t_1);
9820 __pyx_r = __pyx_t_1;
9834 __Pyx_XDECREF(__pyx_t_1);
9835 __Pyx_AddTraceback(
"View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9838 __Pyx_XGIVEREF(__pyx_r);
9839 __Pyx_RefNannyFinishContext();
9851 static PyObject *__pyx_array_get_memview(
struct __pyx_array_obj *__pyx_v_self) {
9853 PyObject *__pyx_r = NULL;
9854 __Pyx_RefNannyDeclarations
9855 PyObject *__pyx_t_1 = NULL;
9856 PyObject *__pyx_t_2 = NULL;
9857 PyObject *__pyx_t_3 = NULL;
9858 int __pyx_lineno = 0;
9859 const char *__pyx_filename = NULL;
9860 int __pyx_clineno = 0;
9861 __Pyx_RefNannySetupContext(
"get_memview", 0);
9870 __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE);
9879 __Pyx_XDECREF(__pyx_r);
9880 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 228, __pyx_L1_error)
9881 __Pyx_GOTREF(__pyx_t_1);
9882 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 228, __pyx_L1_error)
9883 __Pyx_GOTREF(__pyx_t_2);
9884 __pyx_t_3 = PyTuple_New(3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 228, __pyx_L1_error)
9885 __Pyx_GOTREF(__pyx_t_3);
9886 __Pyx_INCREF(((PyObject *)__pyx_v_self));
9887 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
9888 PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
9889 __Pyx_GIVEREF(__pyx_t_1);
9890 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
9891 __Pyx_GIVEREF(__pyx_t_2);
9892 PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
9895 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 228, __pyx_L1_error)
9896 __Pyx_GOTREF(__pyx_t_2);
9897 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9898 __pyx_r = __pyx_t_2;
9912 __Pyx_XDECREF(__pyx_t_1);
9913 __Pyx_XDECREF(__pyx_t_2);
9914 __Pyx_XDECREF(__pyx_t_3);
9915 __Pyx_AddTraceback(
"View.MemoryView.array.get_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
9918 __Pyx_XGIVEREF(__pyx_r);
9919 __Pyx_RefNannyFinishContext();
9932 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self);
9933 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self) {
9935 __Pyx_RefNannyDeclarations
9936 __Pyx_RefNannySetupContext(
"__len__ (wrapper)", 0);
9937 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(((
struct __pyx_array_obj *)__pyx_v_self));
9940 __Pyx_RefNannyFinishContext();
9944 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(
struct __pyx_array_obj *__pyx_v_self) {
9946 __Pyx_RefNannyDeclarations
9947 __Pyx_RefNannySetupContext(
"__len__", 0);
9956 __pyx_r = (__pyx_v_self->_shape[0]);
9969 __Pyx_RefNannyFinishContext();
9982 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr);
9983 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) {
9984 PyObject *__pyx_r = 0;
9985 __Pyx_RefNannyDeclarations
9986 __Pyx_RefNannySetupContext(
"__getattr__ (wrapper)", 0);
9987 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(((
struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr));
9990 __Pyx_RefNannyFinishContext();
9994 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) {
9995 PyObject *__pyx_r = NULL;
9996 __Pyx_RefNannyDeclarations
9997 PyObject *__pyx_t_1 = NULL;
9998 PyObject *__pyx_t_2 = NULL;
9999 int __pyx_lineno = 0;
10000 const char *__pyx_filename = NULL;
10001 int __pyx_clineno = 0;
10002 __Pyx_RefNannySetupContext(
"__getattr__", 0);
10011 __Pyx_XDECREF(__pyx_r);
10012 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 234, __pyx_L1_error)
10013 __Pyx_GOTREF(__pyx_t_1);
10014 __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 234, __pyx_L1_error)
10015 __Pyx_GOTREF(__pyx_t_2);
10016 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10017 __pyx_r = __pyx_t_2;
10031 __Pyx_XDECREF(__pyx_t_1);
10032 __Pyx_XDECREF(__pyx_t_2);
10033 __Pyx_AddTraceback(
"View.MemoryView.array.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10036 __Pyx_XGIVEREF(__pyx_r);
10037 __Pyx_RefNannyFinishContext();
10050 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item);
10051 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
10052 PyObject *__pyx_r = 0;
10053 __Pyx_RefNannyDeclarations
10054 __Pyx_RefNannySetupContext(
"__getitem__ (wrapper)", 0);
10055 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(((
struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item));
10058 __Pyx_RefNannyFinishContext();
10062 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) {
10063 PyObject *__pyx_r = NULL;
10064 __Pyx_RefNannyDeclarations
10065 PyObject *__pyx_t_1 = NULL;
10066 PyObject *__pyx_t_2 = NULL;
10067 int __pyx_lineno = 0;
10068 const char *__pyx_filename = NULL;
10069 int __pyx_clineno = 0;
10070 __Pyx_RefNannySetupContext(
"__getitem__", 0);
10079 __Pyx_XDECREF(__pyx_r);
10080 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 237, __pyx_L1_error)
10081 __Pyx_GOTREF(__pyx_t_1);
10082 __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_item);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 237, __pyx_L1_error)
10083 __Pyx_GOTREF(__pyx_t_2);
10084 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10085 __pyx_r = __pyx_t_2;
10099 __Pyx_XDECREF(__pyx_t_1);
10100 __Pyx_XDECREF(__pyx_t_2);
10101 __Pyx_AddTraceback(
"View.MemoryView.array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10104 __Pyx_XGIVEREF(__pyx_r);
10105 __Pyx_RefNannyFinishContext();
10118 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value);
10119 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
10121 __Pyx_RefNannyDeclarations
10122 __Pyx_RefNannySetupContext(
"__setitem__ (wrapper)", 0);
10123 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(((
struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item), ((PyObject *)__pyx_v_value));
10126 __Pyx_RefNannyFinishContext();
10130 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
10132 __Pyx_RefNannyDeclarations
10133 PyObject *__pyx_t_1 = NULL;
10134 int __pyx_lineno = 0;
10135 const char *__pyx_filename = NULL;
10136 int __pyx_clineno = 0;
10137 __Pyx_RefNannySetupContext(
"__setitem__", 0);
10146 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 240, __pyx_L1_error)
10147 __Pyx_GOTREF(__pyx_t_1);
10148 if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(1, 240, __pyx_L1_error)
10149 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10163 __Pyx_XDECREF(__pyx_t_1);
10164 __Pyx_AddTraceback(
"View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10167 __Pyx_RefNannyFinishContext();
10178 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
10179 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10180 PyObject *__pyx_r = 0;
10181 __Pyx_RefNannyDeclarations
10182 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
10183 __pyx_r = __pyx_pf___pyx_array___reduce_cython__(((
struct __pyx_array_obj *)__pyx_v_self));
10186 __Pyx_RefNannyFinishContext();
10190 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED
struct __pyx_array_obj *__pyx_v_self) {
10191 PyObject *__pyx_r = NULL;
10192 __Pyx_RefNannyDeclarations
10193 PyObject *__pyx_t_1 = NULL;
10194 int __pyx_lineno = 0;
10195 const char *__pyx_filename = NULL;
10196 int __pyx_clineno = 0;
10197 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
10205 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__15, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
10206 __Pyx_GOTREF(__pyx_t_1);
10207 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
10208 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10209 __PYX_ERR(1, 2, __pyx_L1_error)
10219 __Pyx_XDECREF(__pyx_t_1);
10220 __Pyx_AddTraceback(
"View.MemoryView.array.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10222 __Pyx_XGIVEREF(__pyx_r);
10223 __Pyx_RefNannyFinishContext();
10235 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
10236 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
10237 PyObject *__pyx_r = 0;
10238 __Pyx_RefNannyDeclarations
10239 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
10240 __pyx_r = __pyx_pf___pyx_array_2__setstate_cython__(((
struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
10243 __Pyx_RefNannyFinishContext();
10247 static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
10248 PyObject *__pyx_r = NULL;
10249 __Pyx_RefNannyDeclarations
10250 PyObject *__pyx_t_1 = NULL;
10251 int __pyx_lineno = 0;
10252 const char *__pyx_filename = NULL;
10253 int __pyx_clineno = 0;
10254 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
10261 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__16, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
10262 __Pyx_GOTREF(__pyx_t_1);
10263 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
10264 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10265 __PYX_ERR(1, 4, __pyx_L1_error)
10276 __Pyx_XDECREF(__pyx_t_1);
10277 __Pyx_AddTraceback(
"View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10279 __Pyx_XGIVEREF(__pyx_r);
10280 __Pyx_RefNannyFinishContext();
10292 static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize,
char *__pyx_v_format,
char *__pyx_v_mode,
char *__pyx_v_buf) {
10293 struct __pyx_array_obj *__pyx_v_result = 0;
10294 struct __pyx_array_obj *__pyx_r = NULL;
10295 __Pyx_RefNannyDeclarations
10297 PyObject *__pyx_t_2 = NULL;
10298 PyObject *__pyx_t_3 = NULL;
10299 PyObject *__pyx_t_4 = NULL;
10300 PyObject *__pyx_t_5 = NULL;
10301 int __pyx_lineno = 0;
10302 const char *__pyx_filename = NULL;
10303 int __pyx_clineno = 0;
10304 __Pyx_RefNannySetupContext(
"array_cwrapper", 0);
10313 __pyx_t_1 = ((__pyx_v_buf == NULL) != 0);
10323 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 249, __pyx_L1_error)
10324 __Pyx_GOTREF(__pyx_t_2);
10325 __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 249, __pyx_L1_error)
10326 __Pyx_GOTREF(__pyx_t_3);
10327 __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 249, __pyx_L1_error)
10328 __Pyx_GOTREF(__pyx_t_4);
10329 __pyx_t_5 = PyTuple_New(4);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 249, __pyx_L1_error)
10330 __Pyx_GOTREF(__pyx_t_5);
10331 __Pyx_INCREF(__pyx_v_shape);
10332 __Pyx_GIVEREF(__pyx_v_shape);
10333 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_shape);
10334 __Pyx_GIVEREF(__pyx_t_2);
10335 PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
10336 __Pyx_GIVEREF(__pyx_t_3);
10337 PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
10338 __Pyx_GIVEREF(__pyx_t_4);
10339 PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
10343 __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_5, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 249, __pyx_L1_error)
10344 __Pyx_GOTREF(__pyx_t_4);
10345 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10346 __pyx_v_result = ((
struct __pyx_array_obj *)__pyx_t_4);
10367 __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 251, __pyx_L1_error)
10368 __Pyx_GOTREF(__pyx_t_4);
10369 __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 251, __pyx_L1_error)
10370 __Pyx_GOTREF(__pyx_t_5);
10371 __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 251, __pyx_L1_error)
10372 __Pyx_GOTREF(__pyx_t_3);
10373 __pyx_t_2 = PyTuple_New(4);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 251, __pyx_L1_error)
10374 __Pyx_GOTREF(__pyx_t_2);
10375 __Pyx_INCREF(__pyx_v_shape);
10376 __Pyx_GIVEREF(__pyx_v_shape);
10377 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_shape);
10378 __Pyx_GIVEREF(__pyx_t_4);
10379 PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
10380 __Pyx_GIVEREF(__pyx_t_5);
10381 PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
10382 __Pyx_GIVEREF(__pyx_t_3);
10383 PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3);
10395 __pyx_t_3 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 252, __pyx_L1_error)
10396 __Pyx_GOTREF(__pyx_t_3);
10397 if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(1, 252, __pyx_L1_error)
10406 __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 251, __pyx_L1_error)
10407 __Pyx_GOTREF(__pyx_t_5);
10408 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10409 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10410 __pyx_v_result = ((
struct __pyx_array_obj *)__pyx_t_5);
10420 __pyx_v_result->data = __pyx_v_buf;
10431 __Pyx_XDECREF(((PyObject *)__pyx_r));
10432 __Pyx_INCREF(((PyObject *)__pyx_v_result));
10433 __pyx_r = __pyx_v_result;
10446 __Pyx_XDECREF(__pyx_t_2);
10447 __Pyx_XDECREF(__pyx_t_3);
10448 __Pyx_XDECREF(__pyx_t_4);
10449 __Pyx_XDECREF(__pyx_t_5);
10450 __Pyx_AddTraceback(
"View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
10453 __Pyx_XDECREF((PyObject *)__pyx_v_result);
10454 __Pyx_XGIVEREF((PyObject *)__pyx_r);
10455 __Pyx_RefNannyFinishContext();
10468 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
10469 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
10470 PyObject *__pyx_v_name = 0;
10471 int __pyx_lineno = 0;
10472 const char *__pyx_filename = NULL;
10473 int __pyx_clineno = 0;
10475 __Pyx_RefNannyDeclarations
10476 __Pyx_RefNannySetupContext(
"__init__ (wrapper)", 0);
10478 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0};
10479 PyObject* values[1] = {0};
10480 if (unlikely(__pyx_kwds)) {
10481 Py_ssize_t kw_args;
10482 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
10483 switch (pos_args) {
10484 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10485 CYTHON_FALLTHROUGH;
10487 default:
goto __pyx_L5_argtuple_error;
10489 kw_args = PyDict_Size(__pyx_kwds);
10490 switch (pos_args) {
10492 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
10493 else goto __pyx_L5_argtuple_error;
10495 if (unlikely(kw_args > 0)) {
10496 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__init__") < 0)) __PYX_ERR(1, 281, __pyx_L3_error)
10498 }
else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
10499 goto __pyx_L5_argtuple_error;
10501 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10503 __pyx_v_name = values[0];
10505 goto __pyx_L4_argument_unpacking_done;
10506 __pyx_L5_argtuple_error:;
10507 __Pyx_RaiseArgtupleInvalid(
"__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 281, __pyx_L3_error)
10509 __Pyx_AddTraceback(
"View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10510 __Pyx_RefNannyFinishContext();
10512 __pyx_L4_argument_unpacking_done:;
10513 __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(((
struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name);
10516 __Pyx_RefNannyFinishContext();
10520 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) {
10522 __Pyx_RefNannyDeclarations
10523 __Pyx_RefNannySetupContext(
"__init__", 0);
10532 __Pyx_INCREF(__pyx_v_name);
10533 __Pyx_GIVEREF(__pyx_v_name);
10534 __Pyx_GOTREF(__pyx_v_self->name);
10535 __Pyx_DECREF(__pyx_v_self->name);
10536 __pyx_v_self->name = __pyx_v_name;
10548 __Pyx_RefNannyFinishContext();
10561 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self);
10562 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) {
10563 PyObject *__pyx_r = 0;
10564 __Pyx_RefNannyDeclarations
10565 __Pyx_RefNannySetupContext(
"__repr__ (wrapper)", 0);
10566 __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(((
struct __pyx_MemviewEnum_obj *)__pyx_v_self));
10569 __Pyx_RefNannyFinishContext();
10573 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(
struct __pyx_MemviewEnum_obj *__pyx_v_self) {
10574 PyObject *__pyx_r = NULL;
10575 __Pyx_RefNannyDeclarations
10576 __Pyx_RefNannySetupContext(
"__repr__", 0);
10585 __Pyx_XDECREF(__pyx_r);
10586 __Pyx_INCREF(__pyx_v_self->name);
10587 __pyx_r = __pyx_v_self->name;
10600 __Pyx_XGIVEREF(__pyx_r);
10601 __Pyx_RefNannyFinishContext();
10612 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
10613 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10614 PyObject *__pyx_r = 0;
10615 __Pyx_RefNannyDeclarations
10616 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
10617 __pyx_r = __pyx_pf___pyx_MemviewEnum___reduce_cython__(((
struct __pyx_MemviewEnum_obj *)__pyx_v_self));
10620 __Pyx_RefNannyFinishContext();
10624 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self) {
10625 PyObject *__pyx_v_state = 0;
10626 PyObject *__pyx_v__dict = 0;
10627 int __pyx_v_use_setstate;
10628 PyObject *__pyx_r = NULL;
10629 __Pyx_RefNannyDeclarations
10630 PyObject *__pyx_t_1 = NULL;
10633 PyObject *__pyx_t_4 = NULL;
10634 PyObject *__pyx_t_5 = NULL;
10635 int __pyx_lineno = 0;
10636 const char *__pyx_filename = NULL;
10637 int __pyx_clineno = 0;
10638 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
10647 __pyx_t_1 = PyTuple_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
10648 __Pyx_GOTREF(__pyx_t_1);
10649 __Pyx_INCREF(__pyx_v_self->name);
10650 __Pyx_GIVEREF(__pyx_v_self->name);
10651 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->name);
10652 __pyx_v_state = ((PyObject*)__pyx_t_1);
10662 __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
10663 __Pyx_GOTREF(__pyx_t_1);
10664 __pyx_v__dict = __pyx_t_1;
10674 __pyx_t_2 = (__pyx_v__dict != Py_None);
10675 __pyx_t_3 = (__pyx_t_2 != 0);
10685 __pyx_t_1 = PyTuple_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error)
10686 __Pyx_GOTREF(__pyx_t_1);
10687 __Pyx_INCREF(__pyx_v__dict);
10688 __Pyx_GIVEREF(__pyx_v__dict);
10689 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict);
10690 __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 8, __pyx_L1_error)
10691 __Pyx_GOTREF(__pyx_t_4);
10692 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10693 __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
10703 __pyx_v_use_setstate = 1;
10723 __pyx_t_3 = (__pyx_v_self->name != Py_None);
10724 __pyx_v_use_setstate = __pyx_t_3;
10735 __pyx_t_3 = (__pyx_v_use_setstate != 0);
10745 __Pyx_XDECREF(__pyx_r);
10746 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_Enum);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error)
10747 __Pyx_GOTREF(__pyx_t_4);
10748 __pyx_t_1 = PyTuple_New(3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
10749 __Pyx_GOTREF(__pyx_t_1);
10750 __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10751 __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10752 PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10753 __Pyx_INCREF(__pyx_int_184977713);
10754 __Pyx_GIVEREF(__pyx_int_184977713);
10755 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
10756 __Pyx_INCREF(Py_None);
10757 __Pyx_GIVEREF(Py_None);
10758 PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None);
10759 __pyx_t_5 = PyTuple_New(3);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __pyx_L1_error)
10760 __Pyx_GOTREF(__pyx_t_5);
10761 __Pyx_GIVEREF(__pyx_t_4);
10762 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
10763 __Pyx_GIVEREF(__pyx_t_1);
10764 PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
10765 __Pyx_INCREF(__pyx_v_state);
10766 __Pyx_GIVEREF(__pyx_v_state);
10767 PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state);
10770 __pyx_r = __pyx_t_5;
10791 __Pyx_XDECREF(__pyx_r);
10792 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle_Enum);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 15, __pyx_L1_error)
10793 __Pyx_GOTREF(__pyx_t_5);
10794 __pyx_t_1 = PyTuple_New(3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
10795 __Pyx_GOTREF(__pyx_t_1);
10796 __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10797 __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10798 PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10799 __Pyx_INCREF(__pyx_int_184977713);
10800 __Pyx_GIVEREF(__pyx_int_184977713);
10801 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
10802 __Pyx_INCREF(__pyx_v_state);
10803 __Pyx_GIVEREF(__pyx_v_state);
10804 PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
10805 __pyx_t_4 = PyTuple_New(2);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error)
10806 __Pyx_GOTREF(__pyx_t_4);
10807 __Pyx_GIVEREF(__pyx_t_5);
10808 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
10809 __Pyx_GIVEREF(__pyx_t_1);
10810 PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
10813 __pyx_r = __pyx_t_4;
10826 __Pyx_XDECREF(__pyx_t_1);
10827 __Pyx_XDECREF(__pyx_t_4);
10828 __Pyx_XDECREF(__pyx_t_5);
10829 __Pyx_AddTraceback(
"View.MemoryView.Enum.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10832 __Pyx_XDECREF(__pyx_v_state);
10833 __Pyx_XDECREF(__pyx_v__dict);
10834 __Pyx_XGIVEREF(__pyx_r);
10835 __Pyx_RefNannyFinishContext();
10847 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
10848 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
10849 PyObject *__pyx_r = 0;
10850 __Pyx_RefNannyDeclarations
10851 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
10852 __pyx_r = __pyx_pf___pyx_MemviewEnum_2__setstate_cython__(((
struct __pyx_MemviewEnum_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
10855 __Pyx_RefNannyFinishContext();
10859 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
10860 PyObject *__pyx_r = NULL;
10861 __Pyx_RefNannyDeclarations
10862 PyObject *__pyx_t_1 = NULL;
10863 int __pyx_lineno = 0;
10864 const char *__pyx_filename = NULL;
10865 int __pyx_clineno = 0;
10866 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
10873 if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error)
10874 __pyx_t_1 = __pyx_unpickle_Enum__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
10875 __Pyx_GOTREF(__pyx_t_1);
10876 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10886 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10889 __Pyx_XDECREF(__pyx_t_1);
10890 __Pyx_AddTraceback(
"View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10893 __Pyx_XGIVEREF(__pyx_r);
10894 __Pyx_RefNannyFinishContext();
10906 static void *__pyx_align_pointer(
void *__pyx_v_memory,
size_t __pyx_v_alignment) {
10907 Py_intptr_t __pyx_v_aligned_p;
10908 size_t __pyx_v_offset;
10919 __pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory);
10928 __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment);
10937 __pyx_t_1 = ((__pyx_v_offset > 0) != 0);
10947 __pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset));
10965 __pyx_r = ((
void *)__pyx_v_aligned_p);
10990 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
10991 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
10992 PyObject *__pyx_v_obj = 0;
10994 int __pyx_v_dtype_is_object;
10995 int __pyx_lineno = 0;
10996 const char *__pyx_filename = NULL;
10997 int __pyx_clineno = 0;
10999 __Pyx_RefNannyDeclarations
11000 __Pyx_RefNannySetupContext(
"__cinit__ (wrapper)", 0);
11002 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_flags,&__pyx_n_s_dtype_is_object,0};
11003 PyObject* values[3] = {0,0,0};
11004 if (unlikely(__pyx_kwds)) {
11005 Py_ssize_t kw_args;
11006 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
11007 switch (pos_args) {
11008 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
11009 CYTHON_FALLTHROUGH;
11010 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
11011 CYTHON_FALLTHROUGH;
11012 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
11013 CYTHON_FALLTHROUGH;
11015 default:
goto __pyx_L5_argtuple_error;
11017 kw_args = PyDict_Size(__pyx_kwds);
11018 switch (pos_args) {
11020 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
11021 else goto __pyx_L5_argtuple_error;
11022 CYTHON_FALLTHROUGH;
11024 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--;
11026 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 2, 3, 1); __PYX_ERR(1, 345, __pyx_L3_error)
11028 CYTHON_FALLTHROUGH;
11031 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dtype_is_object);
11032 if (value) { values[2] = value; kw_args--; }
11035 if (unlikely(kw_args > 0)) {
11036 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__cinit__") < 0)) __PYX_ERR(1, 345, __pyx_L3_error)
11039 switch (PyTuple_GET_SIZE(__pyx_args)) {
11040 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
11041 CYTHON_FALLTHROUGH;
11042 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
11043 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
11045 default:
goto __pyx_L5_argtuple_error;
11048 __pyx_v_obj = values[0];
11049 __pyx_v_flags = __Pyx_PyInt_As_int(values[1]);
if (unlikely((__pyx_v_flags == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 345, __pyx_L3_error)
11051 __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]);
if (unlikely((__pyx_v_dtype_is_object == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 345, __pyx_L3_error)
11053 __pyx_v_dtype_is_object = ((int)0);
11056 goto __pyx_L4_argument_unpacking_done;
11057 __pyx_L5_argtuple_error:;
11058 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 345, __pyx_L3_error)
11060 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11061 __Pyx_RefNannyFinishContext();
11063 __pyx_L4_argument_unpacking_done:;
11064 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(((
struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_obj, __pyx_v_flags, __pyx_v_dtype_is_object);
11067 __Pyx_RefNannyFinishContext();
11071 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj,
int __pyx_v_flags,
int __pyx_v_dtype_is_object) {
11073 __Pyx_RefNannyDeclarations
11078 int __pyx_lineno = 0;
11079 const char *__pyx_filename = NULL;
11080 int __pyx_clineno = 0;
11081 __Pyx_RefNannySetupContext(
"__cinit__", 0);
11090 __Pyx_INCREF(__pyx_v_obj);
11091 __Pyx_GIVEREF(__pyx_v_obj);
11092 __Pyx_GOTREF(__pyx_v_self->obj);
11093 __Pyx_DECREF(__pyx_v_self->obj);
11094 __pyx_v_self->obj = __pyx_v_obj;
11103 __pyx_v_self->flags = __pyx_v_flags;
11112 __pyx_t_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_memoryview_type));
11113 __pyx_t_3 = (__pyx_t_2 != 0);
11116 __pyx_t_1 = __pyx_t_3;
11117 goto __pyx_L4_bool_binop_done;
11119 __pyx_t_3 = (__pyx_v_obj != Py_None);
11120 __pyx_t_2 = (__pyx_t_3 != 0);
11121 __pyx_t_1 = __pyx_t_2;
11122 __pyx_L4_bool_binop_done:;
11132 __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags);
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(1, 349, __pyx_L1_error)
11141 __pyx_t_1 = ((((PyObject *)__pyx_v_self->view.obj) == NULL) != 0);
11151 ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None;
11160 Py_INCREF(Py_None);
11187 __pyx_t_1 = ((__pyx_memoryview_thread_locks_used < 8) != 0);
11197 __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
11206 __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1);
11224 __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
11234 __pyx_v_self->lock = PyThread_allocate_lock();
11243 __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
11244 if (unlikely(__pyx_t_1)) {
11253 PyErr_NoMemory(); __PYX_ERR(1, 361, __pyx_L1_error)
11280 __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
11290 __pyx_t_2 = (((__pyx_v_self->view.format[0]) ==
'O') != 0);
11293 __pyx_t_1 = __pyx_t_2;
11294 goto __pyx_L11_bool_binop_done;
11296 __pyx_t_2 = (((__pyx_v_self->view.format[1]) ==
'\x00') != 0);
11297 __pyx_t_1 = __pyx_t_2;
11298 __pyx_L11_bool_binop_done:;
11299 __pyx_v_self->dtype_is_object = __pyx_t_1;
11319 __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
11330 __pyx_v_self->acquisition_count_aligned_p = ((__pyx_atomic_int *)__pyx_align_pointer(((
void *)(&(__pyx_v_self->acquisition_count[0]))), (
sizeof(__pyx_atomic_int))));
11339 __pyx_v_self->typeinfo = NULL;
11353 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11356 __Pyx_RefNannyFinishContext();
11369 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self);
11370 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) {
11371 __Pyx_RefNannyDeclarations
11372 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
11373 __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
11376 __Pyx_RefNannyFinishContext();
11379 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(
struct __pyx_memoryview_obj *__pyx_v_self) {
11381 __Pyx_RefNannyDeclarations
11387 PyThread_type_lock __pyx_t_6;
11388 PyThread_type_lock __pyx_t_7;
11389 __Pyx_RefNannySetupContext(
"__dealloc__", 0);
11398 __pyx_t_1 = (__pyx_v_self->obj != Py_None);
11399 __pyx_t_2 = (__pyx_t_1 != 0);
11409 __Pyx_ReleaseBuffer((&__pyx_v_self->view));
11428 __pyx_t_2 = ((((Py_buffer *)(&__pyx_v_self->view))->obj == Py_None) != 0);
11438 ((Py_buffer *)(&__pyx_v_self->view))->obj = NULL;
11447 Py_DECREF(Py_None);
11466 __pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0);
11476 __pyx_t_3 = __pyx_memoryview_thread_locks_used;
11477 __pyx_t_4 = __pyx_t_3;
11478 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
11479 __pyx_v_i = __pyx_t_5;
11488 __pyx_t_2 = (((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock) != 0);
11498 __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1);
11507 __pyx_t_2 = ((__pyx_v_i != __pyx_memoryview_thread_locks_used) != 0);
11517 __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
11518 __pyx_t_7 = (__pyx_memoryview_thread_locks[__pyx_v_i]);
11527 (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_6;
11528 (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_7;
11546 goto __pyx_L6_break;
11566 PyThread_free_lock(__pyx_v_self->lock);
11588 __Pyx_RefNannyFinishContext();
11599 static char *__pyx_memoryview_get_item_pointer(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
11600 Py_ssize_t __pyx_v_dim;
11601 char *__pyx_v_itemp;
11602 PyObject *__pyx_v_idx = NULL;
11604 __Pyx_RefNannyDeclarations
11605 Py_ssize_t __pyx_t_1;
11606 PyObject *__pyx_t_2 = NULL;
11607 Py_ssize_t __pyx_t_3;
11608 PyObject *(*__pyx_t_4)(PyObject *);
11609 PyObject *__pyx_t_5 = NULL;
11610 Py_ssize_t __pyx_t_6;
11612 int __pyx_lineno = 0;
11613 const char *__pyx_filename = NULL;
11614 int __pyx_clineno = 0;
11615 __Pyx_RefNannySetupContext(
"get_item_pointer", 0);
11624 __pyx_v_itemp = ((
char *)__pyx_v_self->view.buf);
11634 if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) {
11635 __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
11638 __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 397, __pyx_L1_error)
11639 __Pyx_GOTREF(__pyx_t_2);
11640 __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext;
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 397, __pyx_L1_error)
11643 if (likely(!__pyx_t_4)) {
11644 if (likely(PyList_CheckExact(__pyx_t_2))) {
11645 if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2))
break;
11646 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11647 __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++;
if (unlikely(0 < 0)) __PYX_ERR(1, 397, __pyx_L1_error)
11649 __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++;
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 397, __pyx_L1_error)
11650 __Pyx_GOTREF(__pyx_t_5);
11653 if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2))
break;
11654 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11655 __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++;
if (unlikely(0 < 0)) __PYX_ERR(1, 397, __pyx_L1_error)
11657 __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++;
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 397, __pyx_L1_error)
11658 __Pyx_GOTREF(__pyx_t_5);
11662 __pyx_t_5 = __pyx_t_4(__pyx_t_2);
11663 if (unlikely(!__pyx_t_5)) {
11664 PyObject* exc_type = PyErr_Occurred();
11666 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
11667 else __PYX_ERR(1, 397, __pyx_L1_error)
11671 __Pyx_GOTREF(__pyx_t_5);
11673 __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_5);
11675 __pyx_v_dim = __pyx_t_1;
11676 __pyx_t_1 = (__pyx_t_1 + 1);
11685 __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx);
if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 398, __pyx_L1_error)
11686 __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim);
if (unlikely(__pyx_t_7 == ((
char *)NULL))) __PYX_ERR(1, 398, __pyx_L1_error)
11687 __pyx_v_itemp = __pyx_t_7;
11697 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11706 __pyx_r = __pyx_v_itemp;
11719 __Pyx_XDECREF(__pyx_t_2);
11720 __Pyx_XDECREF(__pyx_t_5);
11721 __Pyx_AddTraceback(
"View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename);
11724 __Pyx_XDECREF(__pyx_v_idx);
11725 __Pyx_RefNannyFinishContext();
11738 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index);
11739 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
11740 PyObject *__pyx_r = 0;
11741 __Pyx_RefNannyDeclarations
11742 __Pyx_RefNannySetupContext(
"__getitem__ (wrapper)", 0);
11743 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(((
struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index));
11746 __Pyx_RefNannyFinishContext();
11750 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
11751 PyObject *__pyx_v_have_slices = NULL;
11752 PyObject *__pyx_v_indices = NULL;
11753 char *__pyx_v_itemp;
11754 PyObject *__pyx_r = NULL;
11755 __Pyx_RefNannyDeclarations
11758 PyObject *__pyx_t_3 = NULL;
11759 PyObject *__pyx_t_4 = NULL;
11760 PyObject *__pyx_t_5 = NULL;
11762 int __pyx_lineno = 0;
11763 const char *__pyx_filename = NULL;
11764 int __pyx_clineno = 0;
11765 __Pyx_RefNannySetupContext(
"__getitem__", 0);
11774 __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis);
11775 __pyx_t_2 = (__pyx_t_1 != 0);
11785 __Pyx_XDECREF(__pyx_r);
11786 __Pyx_INCREF(((PyObject *)__pyx_v_self));
11787 __pyx_r = ((PyObject *)__pyx_v_self);
11806 __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 407, __pyx_L1_error)
11807 __Pyx_GOTREF(__pyx_t_3);
11808 if (likely(__pyx_t_3 != Py_None)) {
11809 PyObject* sequence = __pyx_t_3;
11810 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
11811 if (unlikely(size != 2)) {
11812 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
11813 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
11814 __PYX_ERR(1, 407, __pyx_L1_error)
11816 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11817 __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
11818 __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
11819 __Pyx_INCREF(__pyx_t_4);
11820 __Pyx_INCREF(__pyx_t_5);
11822 __pyx_t_4 = PySequence_ITEM(sequence, 0);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 407, __pyx_L1_error)
11823 __Pyx_GOTREF(__pyx_t_4);
11824 __pyx_t_5 = PySequence_ITEM(sequence, 1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 407, __pyx_L1_error)
11825 __Pyx_GOTREF(__pyx_t_5);
11827 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11829 __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 407, __pyx_L1_error)
11831 __pyx_v_have_slices = __pyx_t_4;
11833 __pyx_v_indices = __pyx_t_5;
11843 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices);
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 410, __pyx_L1_error)
11853 __Pyx_XDECREF(__pyx_r);
11854 __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices));
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 411, __pyx_L1_error)
11855 __Pyx_GOTREF(__pyx_t_3);
11856 __pyx_r = __pyx_t_3;
11877 __pyx_t_6 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices);
if (unlikely(__pyx_t_6 == ((
char *)NULL))) __PYX_ERR(1, 413, __pyx_L1_error)
11878 __pyx_v_itemp = __pyx_t_6;
11887 __Pyx_XDECREF(__pyx_r);
11888 __pyx_t_3 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 414, __pyx_L1_error)
11889 __Pyx_GOTREF(__pyx_t_3);
11890 __pyx_r = __pyx_t_3;
11905 __Pyx_XDECREF(__pyx_t_3);
11906 __Pyx_XDECREF(__pyx_t_4);
11907 __Pyx_XDECREF(__pyx_t_5);
11908 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11911 __Pyx_XDECREF(__pyx_v_have_slices);
11912 __Pyx_XDECREF(__pyx_v_indices);
11913 __Pyx_XGIVEREF(__pyx_r);
11914 __Pyx_RefNannyFinishContext();
11927 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value);
11928 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
11930 __Pyx_RefNannyDeclarations
11931 __Pyx_RefNannySetupContext(
"__setitem__ (wrapper)", 0);
11932 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(((
struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index), ((PyObject *)__pyx_v_value));
11935 __Pyx_RefNannyFinishContext();
11939 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
11940 PyObject *__pyx_v_have_slices = NULL;
11941 PyObject *__pyx_v_obj = NULL;
11943 __Pyx_RefNannyDeclarations
11945 PyObject *__pyx_t_2 = NULL;
11946 PyObject *__pyx_t_3 = NULL;
11947 PyObject *__pyx_t_4 = NULL;
11948 int __pyx_lineno = 0;
11949 const char *__pyx_filename = NULL;
11950 int __pyx_clineno = 0;
11951 __Pyx_RefNannySetupContext(
"__setitem__", 0);
11952 __Pyx_INCREF(__pyx_v_index);
11961 __pyx_t_1 = (__pyx_v_self->view.readonly != 0);
11962 if (unlikely(__pyx_t_1)) {
11971 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__17, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 418, __pyx_L1_error)
11972 __Pyx_GOTREF(__pyx_t_2);
11973 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
11974 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11975 __PYX_ERR(1, 418, __pyx_L1_error)
11993 __pyx_t_2 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 420, __pyx_L1_error)
11994 __Pyx_GOTREF(__pyx_t_2);
11995 if (likely(__pyx_t_2 != Py_None)) {
11996 PyObject* sequence = __pyx_t_2;
11997 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
11998 if (unlikely(size != 2)) {
11999 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
12000 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
12001 __PYX_ERR(1, 420, __pyx_L1_error)
12003 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
12004 __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
12005 __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
12006 __Pyx_INCREF(__pyx_t_3);
12007 __Pyx_INCREF(__pyx_t_4);
12009 __pyx_t_3 = PySequence_ITEM(sequence, 0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 420, __pyx_L1_error)
12010 __Pyx_GOTREF(__pyx_t_3);
12011 __pyx_t_4 = PySequence_ITEM(sequence, 1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 420, __pyx_L1_error)
12012 __Pyx_GOTREF(__pyx_t_4);
12014 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12016 __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 420, __pyx_L1_error)
12018 __pyx_v_have_slices = __pyx_t_3;
12020 __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_4);
12030 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 422, __pyx_L1_error)
12040 __pyx_t_2 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 423, __pyx_L1_error)
12041 __Pyx_GOTREF(__pyx_t_2);
12042 __pyx_v_obj = __pyx_t_2;
12052 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_obj);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 424, __pyx_L1_error)
12062 __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 425, __pyx_L1_error)
12063 __Pyx_GOTREF(__pyx_t_2);
12064 __pyx_t_4 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_2, __pyx_v_obj);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 425, __pyx_L1_error)
12065 __Pyx_GOTREF(__pyx_t_4);
12066 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12067 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12087 __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 427, __pyx_L1_error)
12088 __Pyx_GOTREF(__pyx_t_4);
12089 if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_memoryview_type))))) __PYX_ERR(1, 427, __pyx_L1_error)
12090 __pyx_t_2 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((
struct __pyx_memoryview_obj *)__pyx_t_4), __pyx_v_value);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 427, __pyx_L1_error)
12091 __Pyx_GOTREF(__pyx_t_2);
12092 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12093 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12115 __pyx_t_2 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 429, __pyx_L1_error)
12116 __Pyx_GOTREF(__pyx_t_2);
12117 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12133 __Pyx_XDECREF(__pyx_t_2);
12134 __Pyx_XDECREF(__pyx_t_3);
12135 __Pyx_XDECREF(__pyx_t_4);
12136 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12139 __Pyx_XDECREF(__pyx_v_have_slices);
12140 __Pyx_XDECREF(__pyx_v_obj);
12141 __Pyx_XDECREF(__pyx_v_index);
12142 __Pyx_RefNannyFinishContext();
12154 static PyObject *__pyx_memoryview_is_slice(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) {
12155 PyObject *__pyx_r = NULL;
12156 __Pyx_RefNannyDeclarations
12159 PyObject *__pyx_t_3 = NULL;
12160 PyObject *__pyx_t_4 = NULL;
12161 PyObject *__pyx_t_5 = NULL;
12162 PyObject *__pyx_t_6 = NULL;
12163 PyObject *__pyx_t_7 = NULL;
12164 PyObject *__pyx_t_8 = NULL;
12166 int __pyx_lineno = 0;
12167 const char *__pyx_filename = NULL;
12168 int __pyx_clineno = 0;
12169 __Pyx_RefNannySetupContext(
"is_slice", 0);
12170 __Pyx_INCREF(__pyx_v_obj);
12179 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_memoryview_type);
12180 __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
12191 __Pyx_PyThreadState_declare
12192 __Pyx_PyThreadState_assign
12193 __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
12194 __Pyx_XGOTREF(__pyx_t_3);
12195 __Pyx_XGOTREF(__pyx_t_4);
12196 __Pyx_XGOTREF(__pyx_t_5);
12206 __pyx_t_6 = __Pyx_PyInt_From_int(((__pyx_v_self->flags & (~PyBUF_WRITABLE)) | PyBUF_ANY_CONTIGUOUS));
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 434, __pyx_L4_error)
12207 __Pyx_GOTREF(__pyx_t_6);
12216 __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 435, __pyx_L4_error)
12217 __Pyx_GOTREF(__pyx_t_7);
12226 __pyx_t_8 = PyTuple_New(3);
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 434, __pyx_L4_error)
12227 __Pyx_GOTREF(__pyx_t_8);
12228 __Pyx_INCREF(__pyx_v_obj);
12229 __Pyx_GIVEREF(__pyx_v_obj);
12230 PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj);
12231 __Pyx_GIVEREF(__pyx_t_6);
12232 PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6);
12233 __Pyx_GIVEREF(__pyx_t_7);
12234 PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7);
12237 __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 434, __pyx_L4_error)
12238 __Pyx_GOTREF(__pyx_t_7);
12239 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
12240 __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7);
12251 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
12252 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
12253 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12254 goto __pyx_L9_try_end;
12256 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
12257 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
12258 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
12267 __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
12269 __Pyx_AddTraceback(
"View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
12270 if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(1, 436, __pyx_L6_except_error)
12271 __Pyx_GOTREF(__pyx_t_7);
12272 __Pyx_GOTREF(__pyx_t_8);
12273 __Pyx_GOTREF(__pyx_t_6);
12282 __Pyx_XDECREF(__pyx_r);
12283 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12284 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12285 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
12286 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
12287 goto __pyx_L7_except_return;
12289 goto __pyx_L6_except_error;
12290 __pyx_L6_except_error:;
12299 __Pyx_XGIVEREF(__pyx_t_3);
12300 __Pyx_XGIVEREF(__pyx_t_4);
12301 __Pyx_XGIVEREF(__pyx_t_5);
12302 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
12303 goto __pyx_L1_error;
12304 __pyx_L7_except_return:;
12305 __Pyx_XGIVEREF(__pyx_t_3);
12306 __Pyx_XGIVEREF(__pyx_t_4);
12307 __Pyx_XGIVEREF(__pyx_t_5);
12308 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
12329 __Pyx_XDECREF(__pyx_r);
12330 __Pyx_INCREF(__pyx_v_obj);
12331 __pyx_r = __pyx_v_obj;
12344 __Pyx_XDECREF(__pyx_t_6);
12345 __Pyx_XDECREF(__pyx_t_7);
12346 __Pyx_XDECREF(__pyx_t_8);
12347 __Pyx_AddTraceback(
"View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
12350 __Pyx_XDECREF(__pyx_v_obj);
12351 __Pyx_XGIVEREF(__pyx_r);
12352 __Pyx_RefNannyFinishContext();
12364 static PyObject *__pyx_memoryview_setitem_slice_assignment(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) {
12365 __Pyx_memviewslice __pyx_v_dst_slice;
12366 __Pyx_memviewslice __pyx_v_src_slice;
12367 PyObject *__pyx_r = NULL;
12368 __Pyx_RefNannyDeclarations
12369 __Pyx_memviewslice *__pyx_t_1;
12370 __Pyx_memviewslice *__pyx_t_2;
12371 PyObject *__pyx_t_3 = NULL;
12375 int __pyx_lineno = 0;
12376 const char *__pyx_filename = NULL;
12377 int __pyx_clineno = 0;
12378 __Pyx_RefNannySetupContext(
"setitem_slice_assignment", 0);
12387 if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(1, 445, __pyx_L1_error)
12388 __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(((
struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice));
if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 445, __pyx_L1_error)
12397 if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(1, 446, __pyx_L1_error)
12398 __pyx_t_2 = __pyx_memoryview_get_slice_from_memoryview(((
struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice));
if (unlikely(__pyx_t_2 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 446, __pyx_L1_error)
12407 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 447, __pyx_L1_error)
12408 __Pyx_GOTREF(__pyx_t_3);
12409 __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3);
if (unlikely((__pyx_t_4 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 447, __pyx_L1_error)
12410 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12411 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 447, __pyx_L1_error)
12412 __Pyx_GOTREF(__pyx_t_3);
12413 __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3);
if (unlikely((__pyx_t_5 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 447, __pyx_L1_error)
12414 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12423 __pyx_t_6 = __pyx_memoryview_copy_contents((__pyx_t_1[0]), (__pyx_t_2[0]), __pyx_t_4, __pyx_t_5, __pyx_v_self->dtype_is_object);
if (unlikely(__pyx_t_6 == ((
int)-1))) __PYX_ERR(1, 445, __pyx_L1_error)
12434 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12437 __Pyx_XDECREF(__pyx_t_3);
12438 __Pyx_AddTraceback(
"View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
12441 __Pyx_XGIVEREF(__pyx_r);
12442 __Pyx_RefNannyFinishContext();
12454 static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(
struct __pyx_memoryview_obj *__pyx_v_self,
struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value) {
12455 int __pyx_v_array[0x80];
12457 void *__pyx_v_item;
12458 __Pyx_memviewslice *__pyx_v_dst_slice;
12459 __Pyx_memviewslice __pyx_v_tmp_slice;
12460 PyObject *__pyx_r = NULL;
12461 __Pyx_RefNannyDeclarations
12462 __Pyx_memviewslice *__pyx_t_1;
12464 PyObject *__pyx_t_3 = NULL;
12467 char const *__pyx_t_6;
12468 PyObject *__pyx_t_7 = NULL;
12469 PyObject *__pyx_t_8 = NULL;
12470 PyObject *__pyx_t_9 = NULL;
12471 PyObject *__pyx_t_10 = NULL;
12472 PyObject *__pyx_t_11 = NULL;
12473 PyObject *__pyx_t_12 = NULL;
12474 int __pyx_lineno = 0;
12475 const char *__pyx_filename = NULL;
12476 int __pyx_clineno = 0;
12477 __Pyx_RefNannySetupContext(
"setitem_slice_assign_scalar", 0);
12486 __pyx_v_tmp = NULL;
12495 __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice));
if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 456, __pyx_L1_error)
12496 __pyx_v_dst_slice = __pyx_t_1;
12505 __pyx_t_2 = ((((size_t)__pyx_v_self->view.itemsize) > (
sizeof(__pyx_v_array))) != 0);
12515 __pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize);
12524 __pyx_t_2 = ((__pyx_v_tmp == NULL) != 0);
12525 if (unlikely(__pyx_t_2)) {
12534 PyErr_NoMemory(); __PYX_ERR(1, 461, __pyx_L1_error)
12552 __pyx_v_item = __pyx_v_tmp;
12572 __pyx_v_item = ((
void *)__pyx_v_array);
12592 __pyx_t_2 = (__pyx_v_self->dtype_is_object != 0);
12602 (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);
12622 __pyx_t_3 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((
char *)__pyx_v_item), __pyx_v_value);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 470, __pyx_L6_error)
12623 __Pyx_GOTREF(__pyx_t_3);
12624 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12635 __pyx_t_2 = ((__pyx_v_self->view.suboffsets != NULL) != 0);
12645 __pyx_t_3 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 475, __pyx_L6_error)
12646 __Pyx_GOTREF(__pyx_t_3);
12647 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12665 __pyx_memoryview_slice_assign_scalar(__pyx_v_dst_slice, __pyx_v_dst->view.ndim, __pyx_v_self->view.itemsize, __pyx_v_item, __pyx_v_self->dtype_is_object);
12677 PyMem_Free(__pyx_v_tmp);
12682 __Pyx_PyThreadState_declare
12683 __Pyx_PyThreadState_assign
12684 __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
12685 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
12686 if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
12687 if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9) < 0)) __Pyx_ErrFetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
12688 __Pyx_XGOTREF(__pyx_t_7);
12689 __Pyx_XGOTREF(__pyx_t_8);
12690 __Pyx_XGOTREF(__pyx_t_9);
12691 __Pyx_XGOTREF(__pyx_t_10);
12692 __Pyx_XGOTREF(__pyx_t_11);
12693 __Pyx_XGOTREF(__pyx_t_12);
12694 __pyx_t_4 = __pyx_lineno; __pyx_t_5 = __pyx_clineno; __pyx_t_6 = __pyx_filename;
12696 PyMem_Free(__pyx_v_tmp);
12698 if (PY_MAJOR_VERSION >= 3) {
12699 __Pyx_XGIVEREF(__pyx_t_10);
12700 __Pyx_XGIVEREF(__pyx_t_11);
12701 __Pyx_XGIVEREF(__pyx_t_12);
12702 __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
12704 __Pyx_XGIVEREF(__pyx_t_7);
12705 __Pyx_XGIVEREF(__pyx_t_8);
12706 __Pyx_XGIVEREF(__pyx_t_9);
12707 __Pyx_ErrRestore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
12708 __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
12709 __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_6;
12710 goto __pyx_L1_error;
12724 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12727 __Pyx_XDECREF(__pyx_t_3);
12728 __Pyx_AddTraceback(
"View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
12731 __Pyx_XGIVEREF(__pyx_r);
12732 __Pyx_RefNannyFinishContext();
12744 static PyObject *__pyx_memoryview_setitem_indexed(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
12745 char *__pyx_v_itemp;
12746 PyObject *__pyx_r = NULL;
12747 __Pyx_RefNannyDeclarations
12749 PyObject *__pyx_t_2 = NULL;
12750 int __pyx_lineno = 0;
12751 const char *__pyx_filename = NULL;
12752 int __pyx_clineno = 0;
12753 __Pyx_RefNannySetupContext(
"setitem_indexed", 0);
12762 __pyx_t_1 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index);
if (unlikely(__pyx_t_1 == ((
char *)NULL))) __PYX_ERR(1, 482, __pyx_L1_error)
12763 __pyx_v_itemp = __pyx_t_1;
12772 __pyx_t_2 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 483, __pyx_L1_error)
12773 __Pyx_GOTREF(__pyx_t_2);
12774 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12785 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12788 __Pyx_XDECREF(__pyx_t_2);
12789 __Pyx_AddTraceback(
"View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename);
12792 __Pyx_XGIVEREF(__pyx_r);
12793 __Pyx_RefNannyFinishContext();
12805 static PyObject *__pyx_memoryview_convert_item_to_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp) {
12806 PyObject *__pyx_v_struct = NULL;
12807 PyObject *__pyx_v_bytesitem = 0;
12808 PyObject *__pyx_v_result = NULL;
12809 PyObject *__pyx_r = NULL;
12810 __Pyx_RefNannyDeclarations
12811 PyObject *__pyx_t_1 = NULL;
12812 PyObject *__pyx_t_2 = NULL;
12813 PyObject *__pyx_t_3 = NULL;
12814 PyObject *__pyx_t_4 = NULL;
12815 PyObject *__pyx_t_5 = NULL;
12816 PyObject *__pyx_t_6 = NULL;
12817 PyObject *__pyx_t_7 = NULL;
12819 PyObject *__pyx_t_9 = NULL;
12822 int __pyx_lineno = 0;
12823 const char *__pyx_filename = NULL;
12824 int __pyx_clineno = 0;
12825 __Pyx_RefNannySetupContext(
"convert_item_to_object", 0);
12834 __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 488, __pyx_L1_error)
12835 __Pyx_GOTREF(__pyx_t_1);
12836 __pyx_v_struct = __pyx_t_1;
12846 __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 491, __pyx_L1_error)
12847 __Pyx_GOTREF(__pyx_t_1);
12848 __pyx_v_bytesitem = ((PyObject*)__pyx_t_1);
12859 __Pyx_PyThreadState_declare
12860 __Pyx_PyThreadState_assign
12861 __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
12862 __Pyx_XGOTREF(__pyx_t_2);
12863 __Pyx_XGOTREF(__pyx_t_3);
12864 __Pyx_XGOTREF(__pyx_t_4);
12874 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 493, __pyx_L3_error)
12875 __Pyx_GOTREF(__pyx_t_5);
12876 __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 493, __pyx_L3_error)
12877 __Pyx_GOTREF(__pyx_t_6);
12880 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
12881 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
12882 if (likely(__pyx_t_7)) {
12883 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_5);
12884 __Pyx_INCREF(__pyx_t_7);
12885 __Pyx_INCREF(
function);
12886 __Pyx_DECREF_SET(__pyx_t_5,
function);
12890 #if CYTHON_FAST_PYCALL
12891 if (PyFunction_Check(__pyx_t_5)) {
12892 PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
12893 __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L3_error)
12894 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
12895 __Pyx_GOTREF(__pyx_t_1);
12896 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12899 #if CYTHON_FAST_PYCCALL
12900 if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
12901 PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
12902 __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L3_error)
12903 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
12904 __Pyx_GOTREF(__pyx_t_1);
12905 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12909 __pyx_t_9 = PyTuple_New(2+__pyx_t_8);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 493, __pyx_L3_error)
12910 __Pyx_GOTREF(__pyx_t_9);
12912 __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
12914 __Pyx_GIVEREF(__pyx_t_6);
12915 PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6);
12916 __Pyx_INCREF(__pyx_v_bytesitem);
12917 __Pyx_GIVEREF(__pyx_v_bytesitem);
12918 PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_bytesitem);
12920 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L3_error)
12921 __Pyx_GOTREF(__pyx_t_1);
12922 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
12924 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12925 __pyx_v_result = __pyx_t_1;
12945 __pyx_t_10 = strlen(__pyx_v_self->view.format);
12946 __pyx_t_11 = ((__pyx_t_10 == 1) != 0);
12956 __Pyx_XDECREF(__pyx_r);
12957 __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 498, __pyx_L5_except_error)
12958 __Pyx_GOTREF(__pyx_t_1);
12959 __pyx_r = __pyx_t_1;
12961 goto __pyx_L6_except_return;
12979 __Pyx_XDECREF(__pyx_r);
12980 __Pyx_INCREF(__pyx_v_result);
12981 __pyx_r = __pyx_v_result;
12982 goto __pyx_L6_except_return;
12985 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
12986 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12987 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
12988 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
12989 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
12998 __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9);
12999 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 494, __pyx_L5_except_error)
13000 __Pyx_GOTREF(__pyx_t_6);
13001 __pyx_t_8 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_6);
13002 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13003 __Pyx_ErrRestore(__pyx_t_1, __pyx_t_5, __pyx_t_9);
13004 __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_9 = 0;
13006 __Pyx_AddTraceback(
"View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
13007 if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(1, 494, __pyx_L5_except_error)
13008 __Pyx_GOTREF(__pyx_t_9);
13009 __Pyx_GOTREF(__pyx_t_5);
13010 __Pyx_GOTREF(__pyx_t_1);
13019 __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__18, NULL);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 495, __pyx_L5_except_error)
13020 __Pyx_GOTREF(__pyx_t_6);
13021 __Pyx_Raise(__pyx_t_6, 0, 0, 0);
13022 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13023 __PYX_ERR(1, 495, __pyx_L5_except_error)
13025 goto __pyx_L5_except_error;
13026 __pyx_L5_except_error:;
13035 __Pyx_XGIVEREF(__pyx_t_2);
13036 __Pyx_XGIVEREF(__pyx_t_3);
13037 __Pyx_XGIVEREF(__pyx_t_4);
13038 __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
13039 goto __pyx_L1_error;
13040 __pyx_L6_except_return:;
13041 __Pyx_XGIVEREF(__pyx_t_2);
13042 __Pyx_XGIVEREF(__pyx_t_3);
13043 __Pyx_XGIVEREF(__pyx_t_4);
13044 __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
13058 __Pyx_XDECREF(__pyx_t_1);
13059 __Pyx_XDECREF(__pyx_t_5);
13060 __Pyx_XDECREF(__pyx_t_6);
13061 __Pyx_XDECREF(__pyx_t_7);
13062 __Pyx_XDECREF(__pyx_t_9);
13063 __Pyx_AddTraceback(
"View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
13066 __Pyx_XDECREF(__pyx_v_struct);
13067 __Pyx_XDECREF(__pyx_v_bytesitem);
13068 __Pyx_XDECREF(__pyx_v_result);
13069 __Pyx_XGIVEREF(__pyx_r);
13070 __Pyx_RefNannyFinishContext();
13082 static PyObject *__pyx_memoryview_assign_item_from_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value) {
13083 PyObject *__pyx_v_struct = NULL;
13085 PyObject *__pyx_v_bytesvalue = 0;
13086 Py_ssize_t __pyx_v_i;
13087 PyObject *__pyx_r = NULL;
13088 __Pyx_RefNannyDeclarations
13089 PyObject *__pyx_t_1 = NULL;
13092 PyObject *__pyx_t_4 = NULL;
13093 PyObject *__pyx_t_5 = NULL;
13094 PyObject *__pyx_t_6 = NULL;
13096 PyObject *__pyx_t_8 = NULL;
13097 Py_ssize_t __pyx_t_9;
13098 PyObject *__pyx_t_10 = NULL;
13103 int __pyx_lineno = 0;
13104 const char *__pyx_filename = NULL;
13105 int __pyx_clineno = 0;
13106 __Pyx_RefNannySetupContext(
"assign_item_from_object", 0);
13115 __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 504, __pyx_L1_error)
13116 __Pyx_GOTREF(__pyx_t_1);
13117 __pyx_v_struct = __pyx_t_1;
13127 __pyx_t_2 = PyTuple_Check(__pyx_v_value);
13128 __pyx_t_3 = (__pyx_t_2 != 0);
13138 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 510, __pyx_L1_error)
13139 __Pyx_GOTREF(__pyx_t_1);
13140 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 510, __pyx_L1_error)
13141 __Pyx_GOTREF(__pyx_t_4);
13142 __pyx_t_5 = PyTuple_New(1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 510, __pyx_L1_error)
13143 __Pyx_GOTREF(__pyx_t_5);
13144 __Pyx_GIVEREF(__pyx_t_4);
13145 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
13147 __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_value);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 510, __pyx_L1_error)
13148 __Pyx_GOTREF(__pyx_t_4);
13149 __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 510, __pyx_L1_error)
13150 __Pyx_GOTREF(__pyx_t_6);
13151 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13152 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
13153 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 510, __pyx_L1_error)
13154 __Pyx_GOTREF(__pyx_t_4);
13155 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13156 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13157 if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 510, __pyx_L1_error)
13158 __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
13179 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 512, __pyx_L1_error)
13180 __Pyx_GOTREF(__pyx_t_6);
13181 __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 512, __pyx_L1_error)
13182 __Pyx_GOTREF(__pyx_t_1);
13185 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
13186 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
13187 if (likely(__pyx_t_5)) {
13188 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_6);
13189 __Pyx_INCREF(__pyx_t_5);
13190 __Pyx_INCREF(
function);
13191 __Pyx_DECREF_SET(__pyx_t_6,
function);
13195 #if CYTHON_FAST_PYCALL
13196 if (PyFunction_Check(__pyx_t_6)) {
13197 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
13198 __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error)
13199 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
13200 __Pyx_GOTREF(__pyx_t_4);
13201 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13204 #if CYTHON_FAST_PYCCALL
13205 if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
13206 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
13207 __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error)
13208 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
13209 __Pyx_GOTREF(__pyx_t_4);
13210 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13214 __pyx_t_8 = PyTuple_New(2+__pyx_t_7);
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 512, __pyx_L1_error)
13215 __Pyx_GOTREF(__pyx_t_8);
13217 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
13219 __Pyx_GIVEREF(__pyx_t_1);
13220 PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_1);
13221 __Pyx_INCREF(__pyx_v_value);
13222 __Pyx_GIVEREF(__pyx_v_value);
13223 PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_value);
13225 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error)
13226 __Pyx_GOTREF(__pyx_t_4);
13227 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
13229 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13230 if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 512, __pyx_L1_error)
13231 __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
13244 if (unlikely(__pyx_v_bytesvalue == Py_None)) {
13245 PyErr_SetString(PyExc_TypeError,
"'NoneType' is not iterable");
13246 __PYX_ERR(1, 514, __pyx_L1_error)
13248 __Pyx_INCREF(__pyx_v_bytesvalue);
13249 __pyx_t_10 = __pyx_v_bytesvalue;
13250 __pyx_t_12 = PyBytes_AS_STRING(__pyx_t_10);
13251 __pyx_t_13 = (__pyx_t_12 + PyBytes_GET_SIZE(__pyx_t_10));
13252 for (__pyx_t_14 = __pyx_t_12; __pyx_t_14 < __pyx_t_13; __pyx_t_14++) {
13253 __pyx_t_11 = __pyx_t_14;
13254 __pyx_v_c = (__pyx_t_11[0]);
13263 __pyx_v_i = __pyx_t_9;
13272 __pyx_t_9 = (__pyx_t_9 + 1);
13281 (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c;
13283 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
13294 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
13297 __Pyx_XDECREF(__pyx_t_1);
13298 __Pyx_XDECREF(__pyx_t_4);
13299 __Pyx_XDECREF(__pyx_t_5);
13300 __Pyx_XDECREF(__pyx_t_6);
13301 __Pyx_XDECREF(__pyx_t_8);
13302 __Pyx_XDECREF(__pyx_t_10);
13303 __Pyx_AddTraceback(
"View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
13306 __Pyx_XDECREF(__pyx_v_struct);
13307 __Pyx_XDECREF(__pyx_v_bytesvalue);
13308 __Pyx_XGIVEREF(__pyx_r);
13309 __Pyx_RefNannyFinishContext();
13322 static CYTHON_UNUSED
int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
13323 static CYTHON_UNUSED
int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
13325 __Pyx_RefNannyDeclarations
13326 __Pyx_RefNannySetupContext(
"__getbuffer__ (wrapper)", 0);
13327 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(((
struct __pyx_memoryview_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((
int)__pyx_v_flags));
13330 __Pyx_RefNannyFinishContext();
13334 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(
struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
13336 __Pyx_RefNannyDeclarations
13339 PyObject *__pyx_t_3 = NULL;
13340 Py_ssize_t *__pyx_t_4;
13344 Py_ssize_t __pyx_t_8;
13345 int __pyx_lineno = 0;
13346 const char *__pyx_filename = NULL;
13347 int __pyx_clineno = 0;
13348 if (__pyx_v_info == NULL) {
13349 PyErr_SetString(PyExc_BufferError,
"PyObject_GetBuffer: view==NULL argument is obsolete");
13352 __Pyx_RefNannySetupContext(
"__getbuffer__", 0);
13353 __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
13354 __Pyx_GIVEREF(__pyx_v_info->obj);
13363 __pyx_t_2 = ((__pyx_v_flags & PyBUF_WRITABLE) != 0);
13366 __pyx_t_1 = __pyx_t_2;
13367 goto __pyx_L4_bool_binop_done;
13369 __pyx_t_2 = (__pyx_v_self->view.readonly != 0);
13370 __pyx_t_1 = __pyx_t_2;
13371 __pyx_L4_bool_binop_done:;
13372 if (unlikely(__pyx_t_1)) {
13381 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__19, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 520, __pyx_L1_error)
13382 __Pyx_GOTREF(__pyx_t_3);
13383 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
13384 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13385 __PYX_ERR(1, 520, __pyx_L1_error)
13403 __pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0);
13413 __pyx_t_4 = __pyx_v_self->view.shape;
13414 __pyx_v_info->shape = __pyx_t_4;
13434 __pyx_v_info->shape = NULL;
13445 __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
13455 __pyx_t_4 = __pyx_v_self->view.strides;
13456 __pyx_v_info->strides = __pyx_t_4;
13476 __pyx_v_info->strides = NULL;
13487 __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0);
13497 __pyx_t_4 = __pyx_v_self->view.suboffsets;
13498 __pyx_v_info->suboffsets = __pyx_t_4;
13518 __pyx_v_info->suboffsets = NULL;
13529 __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
13539 __pyx_t_5 = __pyx_v_self->view.format;
13540 __pyx_v_info->format = __pyx_t_5;
13560 __pyx_v_info->format = NULL;
13571 __pyx_t_6 = __pyx_v_self->view.buf;
13572 __pyx_v_info->buf = __pyx_t_6;
13581 __pyx_t_7 = __pyx_v_self->view.ndim;
13582 __pyx_v_info->ndim = __pyx_t_7;
13591 __pyx_t_8 = __pyx_v_self->view.itemsize;
13592 __pyx_v_info->itemsize = __pyx_t_8;
13601 __pyx_t_8 = __pyx_v_self->view.len;
13602 __pyx_v_info->len = __pyx_t_8;
13611 __pyx_t_1 = __pyx_v_self->view.readonly;
13612 __pyx_v_info->readonly = __pyx_t_1;
13621 __Pyx_INCREF(((PyObject *)__pyx_v_self));
13622 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
13623 __Pyx_GOTREF(__pyx_v_info->obj);
13624 __Pyx_DECREF(__pyx_v_info->obj);
13625 __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
13639 __Pyx_XDECREF(__pyx_t_3);
13640 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13642 if (__pyx_v_info->obj != NULL) {
13643 __Pyx_GOTREF(__pyx_v_info->obj);
13644 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
13648 if (__pyx_v_info->obj == Py_None) {
13649 __Pyx_GOTREF(__pyx_v_info->obj);
13650 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
13653 __Pyx_RefNannyFinishContext();
13666 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self);
13667 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self) {
13668 PyObject *__pyx_r = 0;
13669 __Pyx_RefNannyDeclarations
13670 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
13671 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13674 __Pyx_RefNannyFinishContext();
13678 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
13679 struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
13680 PyObject *__pyx_r = NULL;
13681 __Pyx_RefNannyDeclarations
13682 PyObject *__pyx_t_1 = NULL;
13684 int __pyx_lineno = 0;
13685 const char *__pyx_filename = NULL;
13686 int __pyx_clineno = 0;
13687 __Pyx_RefNannySetupContext(
"__get__", 0);
13696 __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 554, __pyx_L1_error)
13697 __Pyx_GOTREF(__pyx_t_1);
13698 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(1, 554, __pyx_L1_error)
13699 __pyx_v_result = ((
struct __pyx_memoryviewslice_obj *)__pyx_t_1);
13709 __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice));
if (unlikely(__pyx_t_2 == ((
int)0))) __PYX_ERR(1, 555, __pyx_L1_error)
13718 __Pyx_XDECREF(__pyx_r);
13719 __Pyx_INCREF(((PyObject *)__pyx_v_result));
13720 __pyx_r = ((PyObject *)__pyx_v_result);
13733 __Pyx_XDECREF(__pyx_t_1);
13734 __Pyx_AddTraceback(
"View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13737 __Pyx_XDECREF((PyObject *)__pyx_v_result);
13738 __Pyx_XGIVEREF(__pyx_r);
13739 __Pyx_RefNannyFinishContext();
13752 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self);
13753 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self) {
13754 PyObject *__pyx_r = 0;
13755 __Pyx_RefNannyDeclarations
13756 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
13757 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13760 __Pyx_RefNannyFinishContext();
13764 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
13765 PyObject *__pyx_r = NULL;
13766 __Pyx_RefNannyDeclarations
13767 __Pyx_RefNannySetupContext(
"__get__", 0);
13776 __Pyx_XDECREF(__pyx_r);
13777 __Pyx_INCREF(__pyx_v_self->obj);
13778 __pyx_r = __pyx_v_self->obj;
13791 __Pyx_XGIVEREF(__pyx_r);
13792 __Pyx_RefNannyFinishContext();
13805 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self);
13806 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self) {
13807 PyObject *__pyx_r = 0;
13808 __Pyx_RefNannyDeclarations
13809 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
13810 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13813 __Pyx_RefNannyFinishContext();
13817 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
13818 Py_ssize_t __pyx_v_length;
13819 PyObject *__pyx_r = NULL;
13820 __Pyx_RefNannyDeclarations
13821 PyObject *__pyx_t_1 = NULL;
13822 Py_ssize_t *__pyx_t_2;
13823 Py_ssize_t *__pyx_t_3;
13824 Py_ssize_t *__pyx_t_4;
13825 PyObject *__pyx_t_5 = NULL;
13826 int __pyx_lineno = 0;
13827 const char *__pyx_filename = NULL;
13828 int __pyx_clineno = 0;
13829 __Pyx_RefNannySetupContext(
"__get__", 0);
13838 __Pyx_XDECREF(__pyx_r);
13839 __pyx_t_1 = PyList_New(0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 564, __pyx_L1_error)
13840 __Pyx_GOTREF(__pyx_t_1);
13841 __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
13842 for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
13843 __pyx_t_2 = __pyx_t_4;
13844 __pyx_v_length = (__pyx_t_2[0]);
13845 __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 564, __pyx_L1_error)
13846 __Pyx_GOTREF(__pyx_t_5);
13847 if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 564, __pyx_L1_error)
13848 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13850 __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1));
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 564, __pyx_L1_error)
13851 __Pyx_GOTREF(__pyx_t_5);
13852 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13853 __pyx_r = __pyx_t_5;
13867 __Pyx_XDECREF(__pyx_t_1);
13868 __Pyx_XDECREF(__pyx_t_5);
13869 __Pyx_AddTraceback(
"View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13872 __Pyx_XGIVEREF(__pyx_r);
13873 __Pyx_RefNannyFinishContext();
13886 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self);
13887 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self) {
13888 PyObject *__pyx_r = 0;
13889 __Pyx_RefNannyDeclarations
13890 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
13891 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13894 __Pyx_RefNannyFinishContext();
13898 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
13899 Py_ssize_t __pyx_v_stride;
13900 PyObject *__pyx_r = NULL;
13901 __Pyx_RefNannyDeclarations
13903 PyObject *__pyx_t_2 = NULL;
13904 Py_ssize_t *__pyx_t_3;
13905 Py_ssize_t *__pyx_t_4;
13906 Py_ssize_t *__pyx_t_5;
13907 PyObject *__pyx_t_6 = NULL;
13908 int __pyx_lineno = 0;
13909 const char *__pyx_filename = NULL;
13910 int __pyx_clineno = 0;
13911 __Pyx_RefNannySetupContext(
"__get__", 0);
13920 __pyx_t_1 = ((__pyx_v_self->view.strides == NULL) != 0);
13921 if (unlikely(__pyx_t_1)) {
13930 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__20, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 570, __pyx_L1_error)
13931 __Pyx_GOTREF(__pyx_t_2);
13932 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
13933 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13934 __PYX_ERR(1, 570, __pyx_L1_error)
13952 __Pyx_XDECREF(__pyx_r);
13953 __pyx_t_2 = PyList_New(0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 572, __pyx_L1_error)
13954 __Pyx_GOTREF(__pyx_t_2);
13955 __pyx_t_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim);
13956 for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
13957 __pyx_t_3 = __pyx_t_5;
13958 __pyx_v_stride = (__pyx_t_3[0]);
13959 __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 572, __pyx_L1_error)
13960 __Pyx_GOTREF(__pyx_t_6);
13961 if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(1, 572, __pyx_L1_error)
13962 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13964 __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2));
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 572, __pyx_L1_error)
13965 __Pyx_GOTREF(__pyx_t_6);
13966 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13967 __pyx_r = __pyx_t_6;
13981 __Pyx_XDECREF(__pyx_t_2);
13982 __Pyx_XDECREF(__pyx_t_6);
13983 __Pyx_AddTraceback(
"View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13986 __Pyx_XGIVEREF(__pyx_r);
13987 __Pyx_RefNannyFinishContext();
14000 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self);
14001 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self) {
14002 PyObject *__pyx_r = 0;
14003 __Pyx_RefNannyDeclarations
14004 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
14005 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
14008 __Pyx_RefNannyFinishContext();
14012 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
14013 Py_ssize_t __pyx_v_suboffset;
14014 PyObject *__pyx_r = NULL;
14015 __Pyx_RefNannyDeclarations
14017 PyObject *__pyx_t_2 = NULL;
14018 PyObject *__pyx_t_3 = NULL;
14019 Py_ssize_t *__pyx_t_4;
14020 Py_ssize_t *__pyx_t_5;
14021 Py_ssize_t *__pyx_t_6;
14022 int __pyx_lineno = 0;
14023 const char *__pyx_filename = NULL;
14024 int __pyx_clineno = 0;
14025 __Pyx_RefNannySetupContext(
"__get__", 0);
14034 __pyx_t_1 = ((__pyx_v_self->view.suboffsets == NULL) != 0);
14044 __Pyx_XDECREF(__pyx_r);
14045 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 577, __pyx_L1_error)
14046 __Pyx_GOTREF(__pyx_t_2);
14047 __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__21, __pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 577, __pyx_L1_error)
14048 __Pyx_GOTREF(__pyx_t_3);
14049 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14050 __pyx_r = __pyx_t_3;
14070 __Pyx_XDECREF(__pyx_r);
14071 __pyx_t_3 = PyList_New(0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 579, __pyx_L1_error)
14072 __Pyx_GOTREF(__pyx_t_3);
14073 __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim);
14074 for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) {
14075 __pyx_t_4 = __pyx_t_6;
14076 __pyx_v_suboffset = (__pyx_t_4[0]);
14077 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 579, __pyx_L1_error)
14078 __Pyx_GOTREF(__pyx_t_2);
14079 if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(1, 579, __pyx_L1_error)
14080 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14082 __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 579, __pyx_L1_error)
14083 __Pyx_GOTREF(__pyx_t_2);
14084 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14085 __pyx_r = __pyx_t_2;
14099 __Pyx_XDECREF(__pyx_t_2);
14100 __Pyx_XDECREF(__pyx_t_3);
14101 __Pyx_AddTraceback(
"View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14104 __Pyx_XGIVEREF(__pyx_r);
14105 __Pyx_RefNannyFinishContext();
14118 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self);
14119 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self) {
14120 PyObject *__pyx_r = 0;
14121 __Pyx_RefNannyDeclarations
14122 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
14123 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
14126 __Pyx_RefNannyFinishContext();
14130 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
14131 PyObject *__pyx_r = NULL;
14132 __Pyx_RefNannyDeclarations
14133 PyObject *__pyx_t_1 = NULL;
14134 int __pyx_lineno = 0;
14135 const char *__pyx_filename = NULL;
14136 int __pyx_clineno = 0;
14137 __Pyx_RefNannySetupContext(
"__get__", 0);
14146 __Pyx_XDECREF(__pyx_r);
14147 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 583, __pyx_L1_error)
14148 __Pyx_GOTREF(__pyx_t_1);
14149 __pyx_r = __pyx_t_1;
14163 __Pyx_XDECREF(__pyx_t_1);
14164 __Pyx_AddTraceback(
"View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14167 __Pyx_XGIVEREF(__pyx_r);
14168 __Pyx_RefNannyFinishContext();
14181 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self);
14182 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self) {
14183 PyObject *__pyx_r = 0;
14184 __Pyx_RefNannyDeclarations
14185 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
14186 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
14189 __Pyx_RefNannyFinishContext();
14193 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
14194 PyObject *__pyx_r = NULL;
14195 __Pyx_RefNannyDeclarations
14196 PyObject *__pyx_t_1 = NULL;
14197 int __pyx_lineno = 0;
14198 const char *__pyx_filename = NULL;
14199 int __pyx_clineno = 0;
14200 __Pyx_RefNannySetupContext(
"__get__", 0);
14209 __Pyx_XDECREF(__pyx_r);
14210 __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 587, __pyx_L1_error)
14211 __Pyx_GOTREF(__pyx_t_1);
14212 __pyx_r = __pyx_t_1;
14226 __Pyx_XDECREF(__pyx_t_1);
14227 __Pyx_AddTraceback(
"View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14230 __Pyx_XGIVEREF(__pyx_r);
14231 __Pyx_RefNannyFinishContext();
14244 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self);
14245 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self) {
14246 PyObject *__pyx_r = 0;
14247 __Pyx_RefNannyDeclarations
14248 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
14249 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
14252 __Pyx_RefNannyFinishContext();
14256 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
14257 PyObject *__pyx_r = NULL;
14258 __Pyx_RefNannyDeclarations
14259 PyObject *__pyx_t_1 = NULL;
14260 PyObject *__pyx_t_2 = NULL;
14261 PyObject *__pyx_t_3 = NULL;
14262 int __pyx_lineno = 0;
14263 const char *__pyx_filename = NULL;
14264 int __pyx_clineno = 0;
14265 __Pyx_RefNannySetupContext(
"__get__", 0);
14274 __Pyx_XDECREF(__pyx_r);
14275 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 591, __pyx_L1_error)
14276 __Pyx_GOTREF(__pyx_t_1);
14277 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 591, __pyx_L1_error)
14278 __Pyx_GOTREF(__pyx_t_2);
14279 __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 591, __pyx_L1_error)
14280 __Pyx_GOTREF(__pyx_t_3);
14281 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14282 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14283 __pyx_r = __pyx_t_3;
14297 __Pyx_XDECREF(__pyx_t_1);
14298 __Pyx_XDECREF(__pyx_t_2);
14299 __Pyx_XDECREF(__pyx_t_3);
14300 __Pyx_AddTraceback(
"View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14303 __Pyx_XGIVEREF(__pyx_r);
14304 __Pyx_RefNannyFinishContext();
14317 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self);
14318 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self) {
14319 PyObject *__pyx_r = 0;
14320 __Pyx_RefNannyDeclarations
14321 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
14322 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
14325 __Pyx_RefNannyFinishContext();
14329 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
14330 PyObject *__pyx_v_result = NULL;
14331 PyObject *__pyx_v_length = NULL;
14332 PyObject *__pyx_r = NULL;
14333 __Pyx_RefNannyDeclarations
14336 Py_ssize_t *__pyx_t_3;
14337 Py_ssize_t *__pyx_t_4;
14338 Py_ssize_t *__pyx_t_5;
14339 PyObject *__pyx_t_6 = NULL;
14340 int __pyx_lineno = 0;
14341 const char *__pyx_filename = NULL;
14342 int __pyx_clineno = 0;
14343 __Pyx_RefNannySetupContext(
"__get__", 0);
14352 __pyx_t_1 = (__pyx_v_self->_size == Py_None);
14353 __pyx_t_2 = (__pyx_t_1 != 0);
14363 __Pyx_INCREF(__pyx_int_1);
14364 __pyx_v_result = __pyx_int_1;
14373 __pyx_t_4 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
14374 for (__pyx_t_5 = __pyx_v_self->view.shape; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
14375 __pyx_t_3 = __pyx_t_5;
14376 __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0]));
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 598, __pyx_L1_error)
14377 __Pyx_GOTREF(__pyx_t_6);
14378 __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6);
14388 __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 599, __pyx_L1_error)
14389 __Pyx_GOTREF(__pyx_t_6);
14390 __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6);
14401 __Pyx_INCREF(__pyx_v_result);
14402 __Pyx_GIVEREF(__pyx_v_result);
14403 __Pyx_GOTREF(__pyx_v_self->_size);
14404 __Pyx_DECREF(__pyx_v_self->_size);
14405 __pyx_v_self->_size = __pyx_v_result;
14423 __Pyx_XDECREF(__pyx_r);
14424 __Pyx_INCREF(__pyx_v_self->_size);
14425 __pyx_r = __pyx_v_self->_size;
14438 __Pyx_XDECREF(__pyx_t_6);
14439 __Pyx_AddTraceback(
"View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14442 __Pyx_XDECREF(__pyx_v_result);
14443 __Pyx_XDECREF(__pyx_v_length);
14444 __Pyx_XGIVEREF(__pyx_r);
14445 __Pyx_RefNannyFinishContext();
14458 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self);
14459 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) {
14460 Py_ssize_t __pyx_r;
14461 __Pyx_RefNannyDeclarations
14462 __Pyx_RefNannySetupContext(
"__len__ (wrapper)", 0);
14463 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
14466 __Pyx_RefNannyFinishContext();
14470 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(
struct __pyx_memoryview_obj *__pyx_v_self) {
14471 Py_ssize_t __pyx_r;
14472 __Pyx_RefNannyDeclarations
14474 __Pyx_RefNannySetupContext(
"__len__", 0);
14483 __pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0);
14493 __pyx_r = (__pyx_v_self->view.shape[0]);
14525 __Pyx_RefNannyFinishContext();
14538 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self);
14539 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self) {
14540 PyObject *__pyx_r = 0;
14541 __Pyx_RefNannyDeclarations
14542 __Pyx_RefNannySetupContext(
"__repr__ (wrapper)", 0);
14543 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
14546 __Pyx_RefNannyFinishContext();
14550 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(
struct __pyx_memoryview_obj *__pyx_v_self) {
14551 PyObject *__pyx_r = NULL;
14552 __Pyx_RefNannyDeclarations
14553 PyObject *__pyx_t_1 = NULL;
14554 PyObject *__pyx_t_2 = NULL;
14555 PyObject *__pyx_t_3 = NULL;
14556 int __pyx_lineno = 0;
14557 const char *__pyx_filename = NULL;
14558 int __pyx_clineno = 0;
14559 __Pyx_RefNannySetupContext(
"__repr__", 0);
14568 __Pyx_XDECREF(__pyx_r);
14569 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 612, __pyx_L1_error)
14570 __Pyx_GOTREF(__pyx_t_1);
14571 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 612, __pyx_L1_error)
14572 __Pyx_GOTREF(__pyx_t_2);
14573 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14574 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 612, __pyx_L1_error)
14575 __Pyx_GOTREF(__pyx_t_1);
14576 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14585 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 613, __pyx_L1_error)
14586 __Pyx_GOTREF(__pyx_t_2);
14595 __pyx_t_3 = PyTuple_New(2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 612, __pyx_L1_error)
14596 __Pyx_GOTREF(__pyx_t_3);
14597 __Pyx_GIVEREF(__pyx_t_1);
14598 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
14599 __Pyx_GIVEREF(__pyx_t_2);
14600 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
14603 __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_3);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 612, __pyx_L1_error)
14604 __Pyx_GOTREF(__pyx_t_2);
14605 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14606 __pyx_r = __pyx_t_2;
14620 __Pyx_XDECREF(__pyx_t_1);
14621 __Pyx_XDECREF(__pyx_t_2);
14622 __Pyx_XDECREF(__pyx_t_3);
14623 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14626 __Pyx_XGIVEREF(__pyx_r);
14627 __Pyx_RefNannyFinishContext();
14640 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self);
14641 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self) {
14642 PyObject *__pyx_r = 0;
14643 __Pyx_RefNannyDeclarations
14644 __Pyx_RefNannySetupContext(
"__str__ (wrapper)", 0);
14645 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
14648 __Pyx_RefNannyFinishContext();
14652 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(
struct __pyx_memoryview_obj *__pyx_v_self) {
14653 PyObject *__pyx_r = NULL;
14654 __Pyx_RefNannyDeclarations
14655 PyObject *__pyx_t_1 = NULL;
14656 PyObject *__pyx_t_2 = NULL;
14657 int __pyx_lineno = 0;
14658 const char *__pyx_filename = NULL;
14659 int __pyx_clineno = 0;
14660 __Pyx_RefNannySetupContext(
"__str__", 0);
14669 __Pyx_XDECREF(__pyx_r);
14670 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 616, __pyx_L1_error)
14671 __Pyx_GOTREF(__pyx_t_1);
14672 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 616, __pyx_L1_error)
14673 __Pyx_GOTREF(__pyx_t_2);
14674 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14675 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 616, __pyx_L1_error)
14676 __Pyx_GOTREF(__pyx_t_1);
14677 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14678 __pyx_t_2 = PyTuple_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 616, __pyx_L1_error)
14679 __Pyx_GOTREF(__pyx_t_2);
14680 __Pyx_GIVEREF(__pyx_t_1);
14681 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
14683 __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 616, __pyx_L1_error)
14684 __Pyx_GOTREF(__pyx_t_1);
14685 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14686 __pyx_r = __pyx_t_1;
14700 __Pyx_XDECREF(__pyx_t_1);
14701 __Pyx_XDECREF(__pyx_t_2);
14702 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14705 __Pyx_XGIVEREF(__pyx_r);
14706 __Pyx_RefNannyFinishContext();
14719 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
14720 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14721 PyObject *__pyx_r = 0;
14722 __Pyx_RefNannyDeclarations
14723 __Pyx_RefNannySetupContext(
"is_c_contig (wrapper)", 0);
14724 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(((
struct __pyx_memoryview_obj *)__pyx_v_self));
14727 __Pyx_RefNannyFinishContext();
14731 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(
struct __pyx_memoryview_obj *__pyx_v_self) {
14732 __Pyx_memviewslice *__pyx_v_mslice;
14733 __Pyx_memviewslice __pyx_v_tmp;
14734 PyObject *__pyx_r = NULL;
14735 __Pyx_RefNannyDeclarations
14736 __Pyx_memviewslice *__pyx_t_1;
14737 PyObject *__pyx_t_2 = NULL;
14738 int __pyx_lineno = 0;
14739 const char *__pyx_filename = NULL;
14740 int __pyx_clineno = 0;
14741 __Pyx_RefNannySetupContext(
"is_c_contig", 0);
14750 __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp));
if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 622, __pyx_L1_error)
14751 __pyx_v_mslice = __pyx_t_1;
14760 __Pyx_XDECREF(__pyx_r);
14761 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]),
'C', __pyx_v_self->view.ndim));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 623, __pyx_L1_error)
14762 __Pyx_GOTREF(__pyx_t_2);
14763 __pyx_r = __pyx_t_2;
14777 __Pyx_XDECREF(__pyx_t_2);
14778 __Pyx_AddTraceback(
"View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
14781 __Pyx_XGIVEREF(__pyx_r);
14782 __Pyx_RefNannyFinishContext();
14795 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
14796 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14797 PyObject *__pyx_r = 0;
14798 __Pyx_RefNannyDeclarations
14799 __Pyx_RefNannySetupContext(
"is_f_contig (wrapper)", 0);
14800 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(((
struct __pyx_memoryview_obj *)__pyx_v_self));
14803 __Pyx_RefNannyFinishContext();
14807 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(
struct __pyx_memoryview_obj *__pyx_v_self) {
14808 __Pyx_memviewslice *__pyx_v_mslice;
14809 __Pyx_memviewslice __pyx_v_tmp;
14810 PyObject *__pyx_r = NULL;
14811 __Pyx_RefNannyDeclarations
14812 __Pyx_memviewslice *__pyx_t_1;
14813 PyObject *__pyx_t_2 = NULL;
14814 int __pyx_lineno = 0;
14815 const char *__pyx_filename = NULL;
14816 int __pyx_clineno = 0;
14817 __Pyx_RefNannySetupContext(
"is_f_contig", 0);
14826 __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp));
if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 628, __pyx_L1_error)
14827 __pyx_v_mslice = __pyx_t_1;
14836 __Pyx_XDECREF(__pyx_r);
14837 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]),
'F', __pyx_v_self->view.ndim));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 629, __pyx_L1_error)
14838 __Pyx_GOTREF(__pyx_t_2);
14839 __pyx_r = __pyx_t_2;
14853 __Pyx_XDECREF(__pyx_t_2);
14854 __Pyx_AddTraceback(
"View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
14857 __Pyx_XGIVEREF(__pyx_r);
14858 __Pyx_RefNannyFinishContext();
14871 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
14872 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14873 PyObject *__pyx_r = 0;
14874 __Pyx_RefNannyDeclarations
14875 __Pyx_RefNannySetupContext(
"copy (wrapper)", 0);
14876 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(((
struct __pyx_memoryview_obj *)__pyx_v_self));
14879 __Pyx_RefNannyFinishContext();
14883 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(
struct __pyx_memoryview_obj *__pyx_v_self) {
14884 __Pyx_memviewslice __pyx_v_mslice;
14886 PyObject *__pyx_r = NULL;
14887 __Pyx_RefNannyDeclarations
14888 __Pyx_memviewslice __pyx_t_1;
14889 PyObject *__pyx_t_2 = NULL;
14890 int __pyx_lineno = 0;
14891 const char *__pyx_filename = NULL;
14892 int __pyx_clineno = 0;
14893 __Pyx_RefNannySetupContext(
"copy", 0);
14902 __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS));
14911 __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice));
14920 __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((
char *)
"c"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object);
if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 636, __pyx_L1_error)
14921 __pyx_v_mslice = __pyx_t_1;
14930 __Pyx_XDECREF(__pyx_r);
14931 __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 641, __pyx_L1_error)
14932 __Pyx_GOTREF(__pyx_t_2);
14933 __pyx_r = __pyx_t_2;
14947 __Pyx_XDECREF(__pyx_t_2);
14948 __Pyx_AddTraceback(
"View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
14951 __Pyx_XGIVEREF(__pyx_r);
14952 __Pyx_RefNannyFinishContext();
14965 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
14966 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14967 PyObject *__pyx_r = 0;
14968 __Pyx_RefNannyDeclarations
14969 __Pyx_RefNannySetupContext(
"copy_fortran (wrapper)", 0);
14970 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(((
struct __pyx_memoryview_obj *)__pyx_v_self));
14973 __Pyx_RefNannyFinishContext();
14977 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(
struct __pyx_memoryview_obj *__pyx_v_self) {
14978 __Pyx_memviewslice __pyx_v_src;
14979 __Pyx_memviewslice __pyx_v_dst;
14981 PyObject *__pyx_r = NULL;
14982 __Pyx_RefNannyDeclarations
14983 __Pyx_memviewslice __pyx_t_1;
14984 PyObject *__pyx_t_2 = NULL;
14985 int __pyx_lineno = 0;
14986 const char *__pyx_filename = NULL;
14987 int __pyx_clineno = 0;
14988 __Pyx_RefNannySetupContext(
"copy_fortran", 0);
14997 __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS));
15006 __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src));
15015 __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((
char *)
"fortran"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object);
if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 648, __pyx_L1_error)
15016 __pyx_v_dst = __pyx_t_1;
15025 __Pyx_XDECREF(__pyx_r);
15026 __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 653, __pyx_L1_error)
15027 __Pyx_GOTREF(__pyx_t_2);
15028 __pyx_r = __pyx_t_2;
15042 __Pyx_XDECREF(__pyx_t_2);
15043 __Pyx_AddTraceback(
"View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename);
15046 __Pyx_XGIVEREF(__pyx_r);
15047 __Pyx_RefNannyFinishContext();
15058 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
15059 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
15060 PyObject *__pyx_r = 0;
15061 __Pyx_RefNannyDeclarations
15062 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
15063 __pyx_r = __pyx_pf___pyx_memoryview___reduce_cython__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
15066 __Pyx_RefNannyFinishContext();
15070 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryview_obj *__pyx_v_self) {
15071 PyObject *__pyx_r = NULL;
15072 __Pyx_RefNannyDeclarations
15073 PyObject *__pyx_t_1 = NULL;
15074 int __pyx_lineno = 0;
15075 const char *__pyx_filename = NULL;
15076 int __pyx_clineno = 0;
15077 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
15085 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__22, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
15086 __Pyx_GOTREF(__pyx_t_1);
15087 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
15088 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15089 __PYX_ERR(1, 2, __pyx_L1_error)
15099 __Pyx_XDECREF(__pyx_t_1);
15100 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15102 __Pyx_XGIVEREF(__pyx_r);
15103 __Pyx_RefNannyFinishContext();
15115 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
15116 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
15117 PyObject *__pyx_r = 0;
15118 __Pyx_RefNannyDeclarations
15119 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
15120 __pyx_r = __pyx_pf___pyx_memoryview_2__setstate_cython__(((
struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
15123 __Pyx_RefNannyFinishContext();
15127 static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
15128 PyObject *__pyx_r = NULL;
15129 __Pyx_RefNannyDeclarations
15130 PyObject *__pyx_t_1 = NULL;
15131 int __pyx_lineno = 0;
15132 const char *__pyx_filename = NULL;
15133 int __pyx_clineno = 0;
15134 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
15141 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__23, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
15142 __Pyx_GOTREF(__pyx_t_1);
15143 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
15144 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15145 __PYX_ERR(1, 4, __pyx_L1_error)
15156 __Pyx_XDECREF(__pyx_t_1);
15157 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15159 __Pyx_XGIVEREF(__pyx_r);
15160 __Pyx_RefNannyFinishContext();
15172 static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o,
int __pyx_v_flags,
int __pyx_v_dtype_is_object, __Pyx_TypeInfo *__pyx_v_typeinfo) {
15173 struct __pyx_memoryview_obj *__pyx_v_result = 0;
15174 PyObject *__pyx_r = NULL;
15175 __Pyx_RefNannyDeclarations
15176 PyObject *__pyx_t_1 = NULL;
15177 PyObject *__pyx_t_2 = NULL;
15178 PyObject *__pyx_t_3 = NULL;
15179 int __pyx_lineno = 0;
15180 const char *__pyx_filename = NULL;
15181 int __pyx_clineno = 0;
15182 __Pyx_RefNannySetupContext(
"memoryview_cwrapper", 0);
15191 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 658, __pyx_L1_error)
15192 __Pyx_GOTREF(__pyx_t_1);
15193 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 658, __pyx_L1_error)
15194 __Pyx_GOTREF(__pyx_t_2);
15195 __pyx_t_3 = PyTuple_New(3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 658, __pyx_L1_error)
15196 __Pyx_GOTREF(__pyx_t_3);
15197 __Pyx_INCREF(__pyx_v_o);
15198 __Pyx_GIVEREF(__pyx_v_o);
15199 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o);
15200 __Pyx_GIVEREF(__pyx_t_1);
15201 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
15202 __Pyx_GIVEREF(__pyx_t_2);
15203 PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
15206 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 658, __pyx_L1_error)
15207 __Pyx_GOTREF(__pyx_t_2);
15208 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15209 __pyx_v_result = ((
struct __pyx_memoryview_obj *)__pyx_t_2);
15219 __pyx_v_result->typeinfo = __pyx_v_typeinfo;
15228 __Pyx_XDECREF(__pyx_r);
15229 __Pyx_INCREF(((PyObject *)__pyx_v_result));
15230 __pyx_r = ((PyObject *)__pyx_v_result);
15243 __Pyx_XDECREF(__pyx_t_1);
15244 __Pyx_XDECREF(__pyx_t_2);
15245 __Pyx_XDECREF(__pyx_t_3);
15246 __Pyx_AddTraceback(
"View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
15249 __Pyx_XDECREF((PyObject *)__pyx_v_result);
15250 __Pyx_XGIVEREF(__pyx_r);
15251 __Pyx_RefNannyFinishContext();
15263 static CYTHON_INLINE
int __pyx_memoryview_check(PyObject *__pyx_v_o) {
15265 __Pyx_RefNannyDeclarations
15267 __Pyx_RefNannySetupContext(
"memoryview_check", 0);
15276 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type);
15277 __pyx_r = __pyx_t_1;
15290 __Pyx_RefNannyFinishContext();
15302 static PyObject *_unellipsify(PyObject *__pyx_v_index,
int __pyx_v_ndim) {
15303 PyObject *__pyx_v_tup = NULL;
15304 PyObject *__pyx_v_result = NULL;
15305 int __pyx_v_have_slices;
15306 int __pyx_v_seen_ellipsis;
15307 CYTHON_UNUSED PyObject *__pyx_v_idx = NULL;
15308 PyObject *__pyx_v_item = NULL;
15309 Py_ssize_t __pyx_v_nslices;
15310 PyObject *__pyx_r = NULL;
15311 __Pyx_RefNannyDeclarations
15314 PyObject *__pyx_t_3 = NULL;
15315 PyObject *__pyx_t_4 = NULL;
15316 Py_ssize_t __pyx_t_5;
15317 PyObject *(*__pyx_t_6)(PyObject *);
15318 PyObject *__pyx_t_7 = NULL;
15319 Py_ssize_t __pyx_t_8;
15322 PyObject *__pyx_t_11 = NULL;
15323 int __pyx_lineno = 0;
15324 const char *__pyx_filename = NULL;
15325 int __pyx_clineno = 0;
15326 __Pyx_RefNannySetupContext(
"_unellipsify", 0);
15335 __pyx_t_1 = PyTuple_Check(__pyx_v_index);
15336 __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
15346 __pyx_t_3 = PyTuple_New(1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 672, __pyx_L1_error)
15347 __Pyx_GOTREF(__pyx_t_3);
15348 __Pyx_INCREF(__pyx_v_index);
15349 __Pyx_GIVEREF(__pyx_v_index);
15350 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index);
15351 __pyx_v_tup = __pyx_t_3;
15372 __Pyx_INCREF(__pyx_v_index);
15373 __pyx_v_tup = __pyx_v_index;
15384 __pyx_t_3 = PyList_New(0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 676, __pyx_L1_error)
15385 __Pyx_GOTREF(__pyx_t_3);
15386 __pyx_v_result = ((PyObject*)__pyx_t_3);
15396 __pyx_v_have_slices = 0;
15405 __pyx_v_seen_ellipsis = 0;
15414 __Pyx_INCREF(__pyx_int_0);
15415 __pyx_t_3 = __pyx_int_0;
15416 if (likely(PyList_CheckExact(__pyx_v_tup)) || PyTuple_CheckExact(__pyx_v_tup)) {
15417 __pyx_t_4 = __pyx_v_tup; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
15420 __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 679, __pyx_L1_error)
15421 __Pyx_GOTREF(__pyx_t_4);
15422 __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext;
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 679, __pyx_L1_error)
15425 if (likely(!__pyx_t_6)) {
15426 if (likely(PyList_CheckExact(__pyx_t_4))) {
15427 if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4))
break;
15428 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
15429 __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++;
if (unlikely(0 < 0)) __PYX_ERR(1, 679, __pyx_L1_error)
15431 __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++;
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 679, __pyx_L1_error)
15432 __Pyx_GOTREF(__pyx_t_7);
15435 if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4))
break;
15436 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
15437 __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++;
if (unlikely(0 < 0)) __PYX_ERR(1, 679, __pyx_L1_error)
15439 __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++;
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 679, __pyx_L1_error)
15440 __Pyx_GOTREF(__pyx_t_7);
15444 __pyx_t_7 = __pyx_t_6(__pyx_t_4);
15445 if (unlikely(!__pyx_t_7)) {
15446 PyObject* exc_type = PyErr_Occurred();
15448 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
15449 else __PYX_ERR(1, 679, __pyx_L1_error)
15453 __Pyx_GOTREF(__pyx_t_7);
15455 __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_7);
15457 __Pyx_INCREF(__pyx_t_3);
15458 __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_3);
15459 __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 679, __pyx_L1_error)
15460 __Pyx_GOTREF(__pyx_t_7);
15461 __Pyx_DECREF(__pyx_t_3);
15462 __pyx_t_3 = __pyx_t_7;
15472 __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis);
15473 __pyx_t_1 = (__pyx_t_2 != 0);
15483 __pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0);
15493 __pyx_t_8 = PyObject_Length(__pyx_v_tup);
if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(1, 682, __pyx_L1_error)
15494 __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1)));
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 682, __pyx_L1_error)
15495 __Pyx_GOTREF(__pyx_t_7);
15496 { Py_ssize_t __pyx_temp;
15497 for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) {
15498 __Pyx_INCREF(__pyx_slice__24);
15499 __Pyx_GIVEREF(__pyx_slice__24);
15500 PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__24);
15503 __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7);
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(1, 682, __pyx_L1_error)
15504 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
15513 __pyx_v_seen_ellipsis = 1;
15533 __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__24);
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(1, 685, __pyx_L1_error)
15544 __pyx_v_have_slices = 1;
15564 __pyx_t_2 = PySlice_Check(__pyx_v_item);
15565 __pyx_t_10 = ((!(__pyx_t_2 != 0)) != 0);
15568 __pyx_t_1 = __pyx_t_10;
15569 goto __pyx_L9_bool_binop_done;
15571 __pyx_t_10 = ((!(PyIndex_Check(__pyx_v_item) != 0)) != 0);
15572 __pyx_t_1 = __pyx_t_10;
15573 __pyx_L9_bool_binop_done:;
15574 if (unlikely(__pyx_t_1)) {
15583 __pyx_t_7 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item)));
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 689, __pyx_L1_error)
15584 __Pyx_GOTREF(__pyx_t_7);
15585 __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_7);
if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 689, __pyx_L1_error)
15586 __Pyx_GOTREF(__pyx_t_11);
15587 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
15588 __Pyx_Raise(__pyx_t_11, 0, 0, 0);
15589 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
15590 __PYX_ERR(1, 689, __pyx_L1_error)
15608 __pyx_t_10 = (__pyx_v_have_slices != 0);
15611 __pyx_t_1 = __pyx_t_10;
15612 goto __pyx_L11_bool_binop_done;
15614 __pyx_t_10 = PySlice_Check(__pyx_v_item);
15615 __pyx_t_2 = (__pyx_t_10 != 0);
15616 __pyx_t_1 = __pyx_t_2;
15617 __pyx_L11_bool_binop_done:;
15618 __pyx_v_have_slices = __pyx_t_1;
15627 __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item);
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(1, 692, __pyx_L1_error)
15639 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
15640 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15649 __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result);
if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(1, 694, __pyx_L1_error)
15650 __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5);
15659 __pyx_t_1 = (__pyx_v_nslices != 0);
15669 __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices));
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 696, __pyx_L1_error)
15670 __Pyx_GOTREF(__pyx_t_3);
15671 { Py_ssize_t __pyx_temp;
15672 for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) {
15673 __Pyx_INCREF(__pyx_slice__24);
15674 __Pyx_GIVEREF(__pyx_slice__24);
15675 PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__24);
15678 __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3);
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(1, 696, __pyx_L1_error)
15679 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15697 __Pyx_XDECREF(__pyx_r);
15698 if (!__pyx_v_have_slices) {
15700 __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 698, __pyx_L1_error)
15701 __Pyx_GOTREF(__pyx_t_4);
15702 __pyx_t_3 = __pyx_t_4;
15704 goto __pyx_L14_bool_binop_done;
15706 __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 698, __pyx_L1_error)
15707 __Pyx_GOTREF(__pyx_t_4);
15708 __pyx_t_3 = __pyx_t_4;
15710 __pyx_L14_bool_binop_done:;
15711 __pyx_t_4 = PyList_AsTuple(__pyx_v_result);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 698, __pyx_L1_error)
15712 __Pyx_GOTREF(__pyx_t_4);
15713 __pyx_t_11 = PyTuple_New(2);
if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 698, __pyx_L1_error)
15714 __Pyx_GOTREF(__pyx_t_11);
15715 __Pyx_GIVEREF(__pyx_t_3);
15716 PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3);
15717 __Pyx_GIVEREF(__pyx_t_4);
15718 PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_4);
15721 __pyx_r = ((PyObject*)__pyx_t_11);
15735 __Pyx_XDECREF(__pyx_t_3);
15736 __Pyx_XDECREF(__pyx_t_4);
15737 __Pyx_XDECREF(__pyx_t_7);
15738 __Pyx_XDECREF(__pyx_t_11);
15739 __Pyx_AddTraceback(
"View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename);
15742 __Pyx_XDECREF(__pyx_v_tup);
15743 __Pyx_XDECREF(__pyx_v_result);
15744 __Pyx_XDECREF(__pyx_v_idx);
15745 __Pyx_XDECREF(__pyx_v_item);
15746 __Pyx_XGIVEREF(__pyx_r);
15747 __Pyx_RefNannyFinishContext();
15759 static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets,
int __pyx_v_ndim) {
15760 Py_ssize_t __pyx_v_suboffset;
15761 PyObject *__pyx_r = NULL;
15762 __Pyx_RefNannyDeclarations
15763 Py_ssize_t *__pyx_t_1;
15764 Py_ssize_t *__pyx_t_2;
15765 Py_ssize_t *__pyx_t_3;
15767 PyObject *__pyx_t_5 = NULL;
15768 int __pyx_lineno = 0;
15769 const char *__pyx_filename = NULL;
15770 int __pyx_clineno = 0;
15771 __Pyx_RefNannySetupContext(
"assert_direct_dimensions", 0);
15780 __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim);
15781 for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) {
15782 __pyx_t_1 = __pyx_t_3;
15783 __pyx_v_suboffset = (__pyx_t_1[0]);
15792 __pyx_t_4 = ((__pyx_v_suboffset >= 0) != 0);
15793 if (unlikely(__pyx_t_4)) {
15802 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__25, NULL);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 703, __pyx_L1_error)
15803 __Pyx_GOTREF(__pyx_t_5);
15804 __Pyx_Raise(__pyx_t_5, 0, 0, 0);
15805 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15806 __PYX_ERR(1, 703, __pyx_L1_error)
15827 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
15830 __Pyx_XDECREF(__pyx_t_5);
15831 __Pyx_AddTraceback(
"View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
15834 __Pyx_XGIVEREF(__pyx_r);
15835 __Pyx_RefNannyFinishContext();
15847 static struct __pyx_memoryview_obj *__pyx_memview_slice(
struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) {
15848 int __pyx_v_new_ndim;
15849 int __pyx_v_suboffset_dim;
15851 __Pyx_memviewslice __pyx_v_src;
15852 __Pyx_memviewslice __pyx_v_dst;
15853 __Pyx_memviewslice *__pyx_v_p_src;
15854 struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0;
15855 __Pyx_memviewslice *__pyx_v_p_dst;
15856 int *__pyx_v_p_suboffset_dim;
15857 Py_ssize_t __pyx_v_start;
15858 Py_ssize_t __pyx_v_stop;
15859 Py_ssize_t __pyx_v_step;
15860 int __pyx_v_have_start;
15861 int __pyx_v_have_stop;
15862 int __pyx_v_have_step;
15863 PyObject *__pyx_v_index = NULL;
15864 struct __pyx_memoryview_obj *__pyx_r = NULL;
15865 __Pyx_RefNannyDeclarations
15868 PyObject *__pyx_t_3 = NULL;
15869 struct __pyx_memoryview_obj *__pyx_t_4;
15872 Py_ssize_t __pyx_t_7;
15873 PyObject *(*__pyx_t_8)(PyObject *);
15874 PyObject *__pyx_t_9 = NULL;
15875 Py_ssize_t __pyx_t_10;
15877 Py_ssize_t __pyx_t_12;
15878 int __pyx_lineno = 0;
15879 const char *__pyx_filename = NULL;
15880 int __pyx_clineno = 0;
15881 __Pyx_RefNannySetupContext(
"memview_slice", 0);
15890 __pyx_v_new_ndim = 0;
15891 __pyx_v_suboffset_dim = -1;
15900 (void)(memset((&__pyx_v_dst), 0, (
sizeof(__pyx_v_dst))));
15909 #ifndef CYTHON_WITHOUT_ASSERTIONS
15910 if (unlikely(!Py_OptimizeFlag)) {
15911 if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) {
15912 PyErr_SetNone(PyExc_AssertionError);
15913 __PYX_ERR(1, 722, __pyx_L1_error)
15925 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
15926 __pyx_t_2 = (__pyx_t_1 != 0);
15936 if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 725, __pyx_L1_error)
15937 __pyx_t_3 = ((PyObject *)__pyx_v_memview);
15938 __Pyx_INCREF(__pyx_t_3);
15939 __pyx_v_memviewsliceobj = ((
struct __pyx_memoryviewslice_obj *)__pyx_t_3);
15949 __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice);
15969 __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src));
15978 __pyx_v_p_src = (&__pyx_v_src);
15989 __pyx_t_4 = __pyx_v_p_src->memview;
15990 __pyx_v_dst.memview = __pyx_t_4;
15999 __pyx_t_5 = __pyx_v_p_src->data;
16000 __pyx_v_dst.data = __pyx_t_5;
16009 __pyx_v_p_dst = (&__pyx_v_dst);
16018 __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim);
16028 if (likely(PyList_CheckExact(__pyx_v_indices)) || PyTuple_CheckExact(__pyx_v_indices)) {
16029 __pyx_t_3 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0;
16032 __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 746, __pyx_L1_error)
16033 __Pyx_GOTREF(__pyx_t_3);
16034 __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext;
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 746, __pyx_L1_error)
16037 if (likely(!__pyx_t_8)) {
16038 if (likely(PyList_CheckExact(__pyx_t_3))) {
16039 if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3))
break;
16040 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
16041 __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++;
if (unlikely(0 < 0)) __PYX_ERR(1, 746, __pyx_L1_error)
16043 __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++;
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 746, __pyx_L1_error)
16044 __Pyx_GOTREF(__pyx_t_9);
16047 if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3))
break;
16048 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
16049 __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++;
if (unlikely(0 < 0)) __PYX_ERR(1, 746, __pyx_L1_error)
16051 __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++;
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 746, __pyx_L1_error)
16052 __Pyx_GOTREF(__pyx_t_9);
16056 __pyx_t_9 = __pyx_t_8(__pyx_t_3);
16057 if (unlikely(!__pyx_t_9)) {
16058 PyObject* exc_type = PyErr_Occurred();
16060 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
16061 else __PYX_ERR(1, 746, __pyx_L1_error)
16065 __Pyx_GOTREF(__pyx_t_9);
16067 __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_9);
16069 __pyx_v_dim = __pyx_t_6;
16070 __pyx_t_6 = (__pyx_t_6 + 1);
16079 __pyx_t_2 = (PyIndex_Check(__pyx_v_index) != 0);
16089 __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index);
if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 751, __pyx_L1_error)
16098 __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0);
if (unlikely(__pyx_t_11 == ((
int)-1))) __PYX_ERR(1, 748, __pyx_L1_error)
16117 __pyx_t_2 = (__pyx_v_index == Py_None);
16118 __pyx_t_1 = (__pyx_t_2 != 0);
16128 (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1;
16137 (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0;
16146 (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1
L;
16155 __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
16175 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 760, __pyx_L1_error)
16176 __Pyx_GOTREF(__pyx_t_9);
16177 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 760, __pyx_L1_error)
16179 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16181 __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9);
if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 760, __pyx_L1_error)
16182 __pyx_t_10 = __pyx_t_12;
16183 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16184 goto __pyx_L7_bool_binop_done;
16187 __pyx_L7_bool_binop_done:;
16188 __pyx_v_start = __pyx_t_10;
16197 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 761, __pyx_L1_error)
16198 __Pyx_GOTREF(__pyx_t_9);
16199 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 761, __pyx_L1_error)
16201 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16203 __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9);
if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 761, __pyx_L1_error)
16204 __pyx_t_10 = __pyx_t_12;
16205 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16206 goto __pyx_L9_bool_binop_done;
16209 __pyx_L9_bool_binop_done:;
16210 __pyx_v_stop = __pyx_t_10;
16219 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 762, __pyx_L1_error)
16220 __Pyx_GOTREF(__pyx_t_9);
16221 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 762, __pyx_L1_error)
16223 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16225 __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9);
if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 762, __pyx_L1_error)
16226 __pyx_t_10 = __pyx_t_12;
16227 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16228 goto __pyx_L11_bool_binop_done;
16231 __pyx_L11_bool_binop_done:;
16232 __pyx_v_step = __pyx_t_10;
16241 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 764, __pyx_L1_error)
16242 __Pyx_GOTREF(__pyx_t_9);
16243 __pyx_t_1 = (__pyx_t_9 != Py_None);
16244 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16245 __pyx_v_have_start = __pyx_t_1;
16254 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 765, __pyx_L1_error)
16255 __Pyx_GOTREF(__pyx_t_9);
16256 __pyx_t_1 = (__pyx_t_9 != Py_None);
16257 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16258 __pyx_v_have_stop = __pyx_t_1;
16267 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 766, __pyx_L1_error)
16268 __Pyx_GOTREF(__pyx_t_9);
16269 __pyx_t_1 = (__pyx_t_9 != Py_None);
16270 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16271 __pyx_v_have_step = __pyx_t_1;
16280 __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1);
if (unlikely(__pyx_t_11 == ((
int)-1))) __PYX_ERR(1, 768, __pyx_L1_error)
16289 __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
16301 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16310 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
16311 __pyx_t_2 = (__pyx_t_1 != 0);
16321 __Pyx_XDECREF(((PyObject *)__pyx_r));
16330 if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError(
"memviewsliceobj"); __PYX_ERR(1, 778, __pyx_L1_error) }
16339 if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError(
"memviewsliceobj"); __PYX_ERR(1, 779, __pyx_L1_error) }
16348 __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 777, __pyx_L1_error)
16349 __Pyx_GOTREF(__pyx_t_3);
16350 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 777, __pyx_L1_error)
16351 __pyx_r = ((
struct __pyx_memoryview_obj *)__pyx_t_3);
16372 __Pyx_XDECREF(((PyObject *)__pyx_r));
16381 __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 782, __pyx_L1_error)
16382 __Pyx_GOTREF(__pyx_t_3);
16391 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 782, __pyx_L1_error)
16392 __pyx_r = ((
struct __pyx_memoryview_obj *)__pyx_t_3);
16407 __Pyx_XDECREF(__pyx_t_3);
16408 __Pyx_XDECREF(__pyx_t_9);
16409 __Pyx_AddTraceback(
"View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
16412 __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj);
16413 __Pyx_XDECREF(__pyx_v_index);
16414 __Pyx_XGIVEREF((PyObject *)__pyx_r);
16415 __Pyx_RefNannyFinishContext();
16427 static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, Py_ssize_t __pyx_v_shape, Py_ssize_t __pyx_v_stride, Py_ssize_t __pyx_v_suboffset,
int __pyx_v_dim,
int __pyx_v_new_ndim,
int *__pyx_v_suboffset_dim, Py_ssize_t __pyx_v_start, Py_ssize_t __pyx_v_stop, Py_ssize_t __pyx_v_step,
int __pyx_v_have_start,
int __pyx_v_have_stop,
int __pyx_v_have_step,
int __pyx_v_is_slice) {
16428 Py_ssize_t __pyx_v_new_shape;
16429 int __pyx_v_negative_step;
16434 int __pyx_lineno = 0;
16435 const char *__pyx_filename = NULL;
16436 int __pyx_clineno = 0;
16445 __pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0);
16455 __pyx_t_1 = ((__pyx_v_start < 0) != 0);
16465 __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
16483 __pyx_t_1 = (0 <= __pyx_v_start);
16485 __pyx_t_1 = (__pyx_v_start < __pyx_v_shape);
16487 __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
16497 __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((
char *)
"Index out of bounds (axis %d)"), __pyx_v_dim);
if (unlikely(__pyx_t_3 == ((
int)-1))) __PYX_ERR(1, 832, __pyx_L1_error)
16526 __pyx_t_1 = ((__pyx_v_have_step != 0) != 0);
16529 __pyx_t_2 = __pyx_t_1;
16530 goto __pyx_L6_bool_binop_done;
16532 __pyx_t_1 = ((__pyx_v_step < 0) != 0);
16533 __pyx_t_2 = __pyx_t_1;
16534 __pyx_L6_bool_binop_done:;
16535 __pyx_v_negative_step = __pyx_t_2;
16544 __pyx_t_1 = (__pyx_v_have_step != 0);
16547 __pyx_t_2 = __pyx_t_1;
16548 goto __pyx_L9_bool_binop_done;
16550 __pyx_t_1 = ((__pyx_v_step == 0) != 0);
16551 __pyx_t_2 = __pyx_t_1;
16552 __pyx_L9_bool_binop_done:;
16562 __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((
char *)
"Step may not be zero (axis %d)"), __pyx_v_dim);
if (unlikely(__pyx_t_3 == ((
int)-1))) __PYX_ERR(1, 838, __pyx_L1_error)
16580 __pyx_t_2 = (__pyx_v_have_start != 0);
16590 __pyx_t_2 = ((__pyx_v_start < 0) != 0);
16600 __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
16609 __pyx_t_2 = ((__pyx_v_start < 0) != 0);
16647 __pyx_t_2 = ((__pyx_v_start >= __pyx_v_shape) != 0);
16657 __pyx_t_2 = (__pyx_v_negative_step != 0);
16667 __pyx_v_start = (__pyx_v_shape - 1);
16687 __pyx_v_start = __pyx_v_shape;
16719 __pyx_t_2 = (__pyx_v_negative_step != 0);
16729 __pyx_v_start = (__pyx_v_shape - 1);
16762 __pyx_t_2 = (__pyx_v_have_stop != 0);
16772 __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
16782 __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape);
16791 __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
16829 __pyx_t_2 = ((__pyx_v_stop > __pyx_v_shape) != 0);
16839 __pyx_v_stop = __pyx_v_shape;
16869 __pyx_t_2 = (__pyx_v_negative_step != 0);
16879 __pyx_v_stop = -1
L;
16899 __pyx_v_stop = __pyx_v_shape;
16912 __pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0);
16940 __pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step);
16949 __pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0);
16959 __pyx_v_new_shape = (__pyx_v_new_shape + 1);
16977 __pyx_t_2 = ((__pyx_v_new_shape < 0) != 0);
16987 __pyx_v_new_shape = 0;
17005 (__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step);
17014 (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape;
17023 (__pyx_v_dst->suboffsets[__pyx_v_new_ndim]) = __pyx_v_suboffset;
17034 __pyx_t_2 = (((__pyx_v_suboffset_dim[0]) < 0) != 0);
17044 __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride));
17064 __pyx_t_3 = (__pyx_v_suboffset_dim[0]);
17065 (__pyx_v_dst->suboffsets[__pyx_t_3]) = ((__pyx_v_dst->suboffsets[__pyx_t_3]) + (__pyx_v_start * __pyx_v_stride));
17076 __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
17086 __pyx_t_2 = ((!(__pyx_v_is_slice != 0)) != 0);
17096 __pyx_t_2 = ((__pyx_v_new_ndim == 0) != 0);
17106 __pyx_v_dst->data = ((((
char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset);
17134 __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((
char *)
"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim);
if (unlikely(__pyx_t_3 == ((
int)-1))) __PYX_ERR(1, 899, __pyx_L1_error)
17156 (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim;
17191 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17193 __Pyx_AddTraceback(
"View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
17195 __Pyx_PyGILState_Release(__pyx_gilstate_save);
17211 static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view,
char *__pyx_v_bufp, Py_ssize_t __pyx_v_index, Py_ssize_t __pyx_v_dim) {
17212 Py_ssize_t __pyx_v_shape;
17213 Py_ssize_t __pyx_v_stride;
17214 Py_ssize_t __pyx_v_suboffset;
17215 Py_ssize_t __pyx_v_itemsize;
17216 char *__pyx_v_resultp;
17218 __Pyx_RefNannyDeclarations
17219 Py_ssize_t __pyx_t_1;
17221 PyObject *__pyx_t_3 = NULL;
17222 PyObject *__pyx_t_4 = NULL;
17223 int __pyx_lineno = 0;
17224 const char *__pyx_filename = NULL;
17225 int __pyx_clineno = 0;
17226 __Pyx_RefNannySetupContext(
"pybuffer_index", 0);
17235 __pyx_v_suboffset = -1
L;
17244 __pyx_t_1 = __pyx_v_view->itemsize;
17245 __pyx_v_itemsize = __pyx_t_1;
17254 __pyx_t_2 = ((__pyx_v_view->ndim == 0) != 0);
17264 if (unlikely(__pyx_v_itemsize == 0)) {
17265 PyErr_SetString(PyExc_ZeroDivisionError,
"integer division or modulo by zero");
17266 __PYX_ERR(1, 917, __pyx_L1_error)
17268 else if (
sizeof(Py_ssize_t) ==
sizeof(
long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_view->len))) {
17269 PyErr_SetString(PyExc_OverflowError,
"value too large to perform division");
17270 __PYX_ERR(1, 917, __pyx_L1_error)
17272 __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize);
17281 __pyx_v_stride = __pyx_v_itemsize;
17301 __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]);
17310 __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]);
17319 __pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0);
17329 __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]);
17349 __pyx_t_2 = ((__pyx_v_index < 0) != 0);
17359 __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim]));
17368 __pyx_t_2 = ((__pyx_v_index < 0) != 0);
17369 if (unlikely(__pyx_t_2)) {
17378 __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 928, __pyx_L1_error)
17379 __Pyx_GOTREF(__pyx_t_3);
17380 __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 928, __pyx_L1_error)
17381 __Pyx_GOTREF(__pyx_t_4);
17382 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17383 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 928, __pyx_L1_error)
17384 __Pyx_GOTREF(__pyx_t_3);
17385 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17386 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
17387 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17388 __PYX_ERR(1, 928, __pyx_L1_error)
17415 __pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0);
17416 if (unlikely(__pyx_t_2)) {
17425 __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 931, __pyx_L1_error)
17426 __Pyx_GOTREF(__pyx_t_3);
17427 __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 931, __pyx_L1_error)
17428 __Pyx_GOTREF(__pyx_t_4);
17429 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17430 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 931, __pyx_L1_error)
17431 __Pyx_GOTREF(__pyx_t_3);
17432 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17433 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
17434 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17435 __PYX_ERR(1, 931, __pyx_L1_error)
17453 __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));
17462 __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
17472 __pyx_v_resultp = ((((
char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);
17490 __pyx_r = __pyx_v_resultp;
17503 __Pyx_XDECREF(__pyx_t_3);
17504 __Pyx_XDECREF(__pyx_t_4);
17505 __Pyx_AddTraceback(
"View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
17508 __Pyx_RefNannyFinishContext();
17520 static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
17522 Py_ssize_t *__pyx_v_shape;
17523 Py_ssize_t *__pyx_v_strides;
17528 Py_ssize_t *__pyx_t_2;
17531 Py_ssize_t __pyx_t_5;
17532 Py_ssize_t __pyx_t_6;
17536 int __pyx_lineno = 0;
17537 const char *__pyx_filename = NULL;
17538 int __pyx_clineno = 0;
17547 __pyx_t_1 = __pyx_v_memslice->memview->view.ndim;
17548 __pyx_v_ndim = __pyx_t_1;
17557 __pyx_t_2 = __pyx_v_memslice->shape;
17558 __pyx_v_shape = __pyx_t_2;
17567 __pyx_t_2 = __pyx_v_memslice->strides;
17568 __pyx_v_strides = __pyx_t_2;
17577 __pyx_t_3 = __Pyx_div_long(__pyx_v_ndim, 2);
17578 __pyx_t_4 = __pyx_t_3;
17579 for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_4; __pyx_t_1+=1) {
17580 __pyx_v_i = __pyx_t_1;
17589 __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i);
17598 __pyx_t_5 = (__pyx_v_strides[__pyx_v_j]);
17599 __pyx_t_6 = (__pyx_v_strides[__pyx_v_i]);
17600 (__pyx_v_strides[__pyx_v_i]) = __pyx_t_5;
17601 (__pyx_v_strides[__pyx_v_j]) = __pyx_t_6;
17610 __pyx_t_6 = (__pyx_v_shape[__pyx_v_j]);
17611 __pyx_t_5 = (__pyx_v_shape[__pyx_v_i]);
17612 (__pyx_v_shape[__pyx_v_i]) = __pyx_t_6;
17613 (__pyx_v_shape[__pyx_v_j]) = __pyx_t_5;
17622 __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0) != 0);
17625 __pyx_t_7 = __pyx_t_8;
17626 goto __pyx_L6_bool_binop_done;
17628 __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0) != 0);
17629 __pyx_t_7 = __pyx_t_8;
17630 __pyx_L6_bool_binop_done:;
17640 __pyx_t_9 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((
char *)
"Cannot transpose memoryview with indirect dimensions"));
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(1, 957, __pyx_L1_error)
17674 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17676 __Pyx_AddTraceback(
"View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
17678 __Pyx_PyGILState_Release(__pyx_gilstate_save);
17695 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self);
17696 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) {
17697 __Pyx_RefNannyDeclarations
17698 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
17699 __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(((
struct __pyx_memoryviewslice_obj *)__pyx_v_self));
17702 __Pyx_RefNannyFinishContext();
17705 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(
struct __pyx_memoryviewslice_obj *__pyx_v_self) {
17706 __Pyx_RefNannyDeclarations
17707 __Pyx_RefNannySetupContext(
"__dealloc__", 0);
17716 __PYX_XDEC_MEMVIEW((&__pyx_v_self->from_slice), 1);
17727 __Pyx_RefNannyFinishContext();
17738 static PyObject *__pyx_memoryviewslice_convert_item_to_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp) {
17739 PyObject *__pyx_r = NULL;
17740 __Pyx_RefNannyDeclarations
17742 PyObject *__pyx_t_2 = NULL;
17743 int __pyx_lineno = 0;
17744 const char *__pyx_filename = NULL;
17745 int __pyx_clineno = 0;
17746 __Pyx_RefNannySetupContext(
"convert_item_to_object", 0);
17755 __pyx_t_1 = ((__pyx_v_self->to_object_func != NULL) != 0);
17765 __Pyx_XDECREF(__pyx_r);
17766 __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 981, __pyx_L1_error)
17767 __Pyx_GOTREF(__pyx_t_2);
17768 __pyx_r = __pyx_t_2;
17789 __Pyx_XDECREF(__pyx_r);
17790 __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((
struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 983, __pyx_L1_error)
17791 __Pyx_GOTREF(__pyx_t_2);
17792 __pyx_r = __pyx_t_2;
17807 __Pyx_XDECREF(__pyx_t_2);
17808 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
17811 __Pyx_XGIVEREF(__pyx_r);
17812 __Pyx_RefNannyFinishContext();
17824 static PyObject *__pyx_memoryviewslice_assign_item_from_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value) {
17825 PyObject *__pyx_r = NULL;
17826 __Pyx_RefNannyDeclarations
17829 PyObject *__pyx_t_3 = NULL;
17830 int __pyx_lineno = 0;
17831 const char *__pyx_filename = NULL;
17832 int __pyx_clineno = 0;
17833 __Pyx_RefNannySetupContext(
"assign_item_from_object", 0);
17842 __pyx_t_1 = ((__pyx_v_self->to_dtype_func != NULL) != 0);
17852 __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value);
if (unlikely(__pyx_t_2 == ((
int)0))) __PYX_ERR(1, 987, __pyx_L1_error)
17872 __pyx_t_3 = __pyx_memoryview_assign_item_from_object(((
struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 989, __pyx_L1_error)
17873 __Pyx_GOTREF(__pyx_t_3);
17874 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17887 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
17890 __Pyx_XDECREF(__pyx_t_3);
17891 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
17894 __Pyx_XGIVEREF(__pyx_r);
17895 __Pyx_RefNannyFinishContext();
17908 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self);
17909 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self) {
17910 PyObject *__pyx_r = 0;
17911 __Pyx_RefNannyDeclarations
17912 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
17913 __pyx_r = __pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(((
struct __pyx_memoryviewslice_obj *)__pyx_v_self));
17916 __Pyx_RefNannyFinishContext();
17920 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(
struct __pyx_memoryviewslice_obj *__pyx_v_self) {
17921 PyObject *__pyx_r = NULL;
17922 __Pyx_RefNannyDeclarations
17923 __Pyx_RefNannySetupContext(
"__get__", 0);
17932 __Pyx_XDECREF(__pyx_r);
17933 __Pyx_INCREF(__pyx_v_self->from_object);
17934 __pyx_r = __pyx_v_self->from_object;
17947 __Pyx_XGIVEREF(__pyx_r);
17948 __Pyx_RefNannyFinishContext();
17959 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
17960 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
17961 PyObject *__pyx_r = 0;
17962 __Pyx_RefNannyDeclarations
17963 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
17964 __pyx_r = __pyx_pf___pyx_memoryviewslice___reduce_cython__(((
struct __pyx_memoryviewslice_obj *)__pyx_v_self));
17967 __Pyx_RefNannyFinishContext();
17971 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryviewslice_obj *__pyx_v_self) {
17972 PyObject *__pyx_r = NULL;
17973 __Pyx_RefNannyDeclarations
17974 PyObject *__pyx_t_1 = NULL;
17975 int __pyx_lineno = 0;
17976 const char *__pyx_filename = NULL;
17977 int __pyx_clineno = 0;
17978 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
17986 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__26, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
17987 __Pyx_GOTREF(__pyx_t_1);
17988 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
17989 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17990 __PYX_ERR(1, 2, __pyx_L1_error)
18000 __Pyx_XDECREF(__pyx_t_1);
18001 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
18003 __Pyx_XGIVEREF(__pyx_r);
18004 __Pyx_RefNannyFinishContext();
18016 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
18017 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
18018 PyObject *__pyx_r = 0;
18019 __Pyx_RefNannyDeclarations
18020 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
18021 __pyx_r = __pyx_pf___pyx_memoryviewslice_2__setstate_cython__(((
struct __pyx_memoryviewslice_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
18024 __Pyx_RefNannyFinishContext();
18028 static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
18029 PyObject *__pyx_r = NULL;
18030 __Pyx_RefNannyDeclarations
18031 PyObject *__pyx_t_1 = NULL;
18032 int __pyx_lineno = 0;
18033 const char *__pyx_filename = NULL;
18034 int __pyx_clineno = 0;
18035 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
18042 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__27, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
18043 __Pyx_GOTREF(__pyx_t_1);
18044 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
18045 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18046 __PYX_ERR(1, 4, __pyx_L1_error)
18057 __Pyx_XDECREF(__pyx_t_1);
18058 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
18060 __Pyx_XGIVEREF(__pyx_r);
18061 __Pyx_RefNannyFinishContext();
18073 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewslice,
int __pyx_v_ndim, PyObject *(*__pyx_v_to_object_func)(
char *),
int (*__pyx_v_to_dtype_func)(
char *, PyObject *),
int __pyx_v_dtype_is_object) {
18074 struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
18075 Py_ssize_t __pyx_v_suboffset;
18076 PyObject *__pyx_v_length = NULL;
18077 PyObject *__pyx_r = NULL;
18078 __Pyx_RefNannyDeclarations
18080 PyObject *__pyx_t_2 = NULL;
18081 PyObject *__pyx_t_3 = NULL;
18082 __Pyx_TypeInfo *__pyx_t_4;
18083 Py_buffer __pyx_t_5;
18084 Py_ssize_t *__pyx_t_6;
18085 Py_ssize_t *__pyx_t_7;
18086 Py_ssize_t *__pyx_t_8;
18087 Py_ssize_t __pyx_t_9;
18088 int __pyx_lineno = 0;
18089 const char *__pyx_filename = NULL;
18090 int __pyx_clineno = 0;
18091 __Pyx_RefNannySetupContext(
"memoryview_fromslice", 0);
18100 __pyx_t_1 = ((((PyObject *)__pyx_v_memviewslice.memview) == Py_None) != 0);
18110 __Pyx_XDECREF(__pyx_r);
18111 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
18130 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1013, __pyx_L1_error)
18131 __Pyx_GOTREF(__pyx_t_2);
18132 __pyx_t_3 = PyTuple_New(3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1013, __pyx_L1_error)
18133 __Pyx_GOTREF(__pyx_t_3);
18134 __Pyx_INCREF(Py_None);
18135 __Pyx_GIVEREF(Py_None);
18136 PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None);
18137 __Pyx_INCREF(__pyx_int_0);
18138 __Pyx_GIVEREF(__pyx_int_0);
18139 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0);
18140 __Pyx_GIVEREF(__pyx_t_2);
18141 PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
18143 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1013, __pyx_L1_error)
18144 __Pyx_GOTREF(__pyx_t_2);
18145 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18146 __pyx_v_result = ((
struct __pyx_memoryviewslice_obj *)__pyx_t_2);
18156 __pyx_v_result->from_slice = __pyx_v_memviewslice;
18165 __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1);
18174 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1018, __pyx_L1_error)
18175 __Pyx_GOTREF(__pyx_t_2);
18176 __Pyx_GIVEREF(__pyx_t_2);
18177 __Pyx_GOTREF(__pyx_v_result->from_object);
18178 __Pyx_DECREF(__pyx_v_result->from_object);
18179 __pyx_v_result->from_object = __pyx_t_2;
18189 __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo;
18190 __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4;
18199 __pyx_t_5 = __pyx_v_memviewslice.memview->view;
18200 __pyx_v_result->__pyx_base.view = __pyx_t_5;
18209 __pyx_v_result->__pyx_base.view.buf = ((
void *)__pyx_v_memviewslice.data);
18218 __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim;
18227 ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None;
18236 Py_INCREF(Py_None);
18245 __pyx_t_1 = ((((
struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->flags & PyBUF_WRITABLE) != 0);
18255 __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS;
18275 __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS_RO;
18286 __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape);
18295 __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides);
18304 __pyx_v_result->__pyx_base.view.suboffsets = NULL;
18313 __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim);
18314 for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
18315 __pyx_t_6 = __pyx_t_8;
18316 __pyx_v_suboffset = (__pyx_t_6[0]);
18325 __pyx_t_1 = ((__pyx_v_suboffset >= 0) != 0);
18335 __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
18344 goto __pyx_L6_break;
18364 __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize;
18365 __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
18374 __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim);
18375 for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
18376 __pyx_t_6 = __pyx_t_8;
18377 __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0]));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1043, __pyx_L1_error)
18378 __Pyx_GOTREF(__pyx_t_2);
18379 __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2);
18389 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1044, __pyx_L1_error)
18390 __Pyx_GOTREF(__pyx_t_2);
18391 __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1044, __pyx_L1_error)
18392 __Pyx_GOTREF(__pyx_t_3);
18393 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18394 __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3);
if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 1044, __pyx_L1_error)
18395 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18396 __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
18406 __pyx_v_result->to_object_func = __pyx_v_to_object_func;
18415 __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func;
18424 __Pyx_XDECREF(__pyx_r);
18425 __Pyx_INCREF(((PyObject *)__pyx_v_result));
18426 __pyx_r = ((PyObject *)__pyx_v_result);
18439 __Pyx_XDECREF(__pyx_t_2);
18440 __Pyx_XDECREF(__pyx_t_3);
18441 __Pyx_AddTraceback(
"View.MemoryView.memoryview_fromslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
18444 __Pyx_XDECREF((PyObject *)__pyx_v_result);
18445 __Pyx_XDECREF(__pyx_v_length);
18446 __Pyx_XGIVEREF(__pyx_r);
18447 __Pyx_RefNannyFinishContext();
18459 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(
struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_mslice) {
18460 struct __pyx_memoryviewslice_obj *__pyx_v_obj = 0;
18461 __Pyx_memviewslice *__pyx_r;
18462 __Pyx_RefNannyDeclarations
18465 PyObject *__pyx_t_3 = NULL;
18466 int __pyx_lineno = 0;
18467 const char *__pyx_filename = NULL;
18468 int __pyx_clineno = 0;
18469 __Pyx_RefNannySetupContext(
"get_slice_from_memview", 0);
18478 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
18479 __pyx_t_2 = (__pyx_t_1 != 0);
18489 if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 1056, __pyx_L1_error)
18490 __pyx_t_3 = ((PyObject *)__pyx_v_memview);
18491 __Pyx_INCREF(__pyx_t_3);
18492 __pyx_v_obj = ((
struct __pyx_memoryviewslice_obj *)__pyx_t_3);
18502 __pyx_r = (&__pyx_v_obj->from_slice);
18522 __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);
18531 __pyx_r = __pyx_v_mslice;
18545 __Pyx_XDECREF(__pyx_t_3);
18546 __Pyx_AddTraceback(
"View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
18549 __Pyx_XDECREF((PyObject *)__pyx_v_obj);
18550 __Pyx_RefNannyFinishContext();
18562 static void __pyx_memoryview_slice_copy(
struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) {
18564 Py_ssize_t *__pyx_v_shape;
18565 Py_ssize_t *__pyx_v_strides;
18566 Py_ssize_t *__pyx_v_suboffsets;
18567 __Pyx_RefNannyDeclarations
18568 Py_ssize_t *__pyx_t_1;
18572 Py_ssize_t __pyx_t_5;
18573 __Pyx_RefNannySetupContext(
"slice_copy", 0);
18582 __pyx_t_1 = __pyx_v_memview->view.shape;
18583 __pyx_v_shape = __pyx_t_1;
18592 __pyx_t_1 = __pyx_v_memview->view.strides;
18593 __pyx_v_strides = __pyx_t_1;
18602 __pyx_t_1 = __pyx_v_memview->view.suboffsets;
18603 __pyx_v_suboffsets = __pyx_t_1;
18612 __pyx_v_dst->memview = ((
struct __pyx_memoryview_obj *)__pyx_v_memview);
18621 __pyx_v_dst->data = ((
char *)__pyx_v_memview->view.buf);
18630 __pyx_t_2 = __pyx_v_memview->view.ndim;
18631 __pyx_t_3 = __pyx_t_2;
18632 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18633 __pyx_v_dim = __pyx_t_4;
18642 (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]);
18651 (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]);
18660 if ((__pyx_v_suboffsets != 0)) {
18661 __pyx_t_5 = (__pyx_v_suboffsets[__pyx_v_dim]);
18665 (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_5;
18677 __Pyx_RefNannyFinishContext();
18688 static PyObject *__pyx_memoryview_copy_object(
struct __pyx_memoryview_obj *__pyx_v_memview) {
18689 __Pyx_memviewslice __pyx_v_memviewslice;
18690 PyObject *__pyx_r = NULL;
18691 __Pyx_RefNannyDeclarations
18692 PyObject *__pyx_t_1 = NULL;
18693 int __pyx_lineno = 0;
18694 const char *__pyx_filename = NULL;
18695 int __pyx_clineno = 0;
18696 __Pyx_RefNannySetupContext(
"memoryview_copy", 0);
18705 __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice));
18714 __Pyx_XDECREF(__pyx_r);
18715 __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1084, __pyx_L1_error)
18716 __Pyx_GOTREF(__pyx_t_1);
18717 __pyx_r = __pyx_t_1;
18731 __Pyx_XDECREF(__pyx_t_1);
18732 __Pyx_AddTraceback(
"View.MemoryView.memoryview_copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
18735 __Pyx_XGIVEREF(__pyx_r);
18736 __Pyx_RefNannyFinishContext();
18748 static PyObject *__pyx_memoryview_copy_object_from_slice(
struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_memviewslice) {
18749 PyObject *(*__pyx_v_to_object_func)(
char *);
18750 int (*__pyx_v_to_dtype_func)(
char *, PyObject *);
18751 PyObject *__pyx_r = NULL;
18752 __Pyx_RefNannyDeclarations
18755 PyObject *(*__pyx_t_3)(
char *);
18756 int (*__pyx_t_4)(
char *, PyObject *);
18757 PyObject *__pyx_t_5 = NULL;
18758 int __pyx_lineno = 0;
18759 const char *__pyx_filename = NULL;
18760 int __pyx_clineno = 0;
18761 __Pyx_RefNannySetupContext(
"memoryview_copy_from_slice", 0);
18770 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
18771 __pyx_t_2 = (__pyx_t_1 != 0);
18781 __pyx_t_3 = ((
struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func;
18782 __pyx_v_to_object_func = __pyx_t_3;
18791 __pyx_t_4 = ((
struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func;
18792 __pyx_v_to_dtype_func = __pyx_t_4;
18812 __pyx_v_to_object_func = NULL;
18821 __pyx_v_to_dtype_func = NULL;
18832 __Pyx_XDECREF(__pyx_r);
18841 __pyx_t_5 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1101, __pyx_L1_error)
18842 __Pyx_GOTREF(__pyx_t_5);
18843 __pyx_r = __pyx_t_5;
18857 __Pyx_XDECREF(__pyx_t_5);
18858 __Pyx_AddTraceback(
"View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
18861 __Pyx_XGIVEREF(__pyx_r);
18862 __Pyx_RefNannyFinishContext();
18874 static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
18875 Py_ssize_t __pyx_r;
18885 __pyx_t_1 = ((__pyx_v_arg < 0) != 0);
18895 __pyx_r = (-__pyx_v_arg);
18915 __pyx_r = __pyx_v_arg;
18940 static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice,
int __pyx_v_ndim) {
18942 Py_ssize_t __pyx_v_c_stride;
18943 Py_ssize_t __pyx_v_f_stride;
18957 __pyx_v_c_stride = 0;
18966 __pyx_v_f_stride = 0;
18975 for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
18976 __pyx_v_i = __pyx_t_1;
18985 __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
18995 __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
19004 goto __pyx_L4_break;
19024 __pyx_t_1 = __pyx_v_ndim;
19025 __pyx_t_3 = __pyx_t_1;
19026 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
19027 __pyx_v_i = __pyx_t_4;
19036 __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
19046 __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
19055 goto __pyx_L7_break;
19075 __pyx_t_2 = ((abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride)) != 0);
19130 static void _copy_strided_to_strided(
char *__pyx_v_src_data, Py_ssize_t *__pyx_v_src_strides,
char *__pyx_v_dst_data, Py_ssize_t *__pyx_v_dst_strides, Py_ssize_t *__pyx_v_src_shape, Py_ssize_t *__pyx_v_dst_shape,
int __pyx_v_ndim,
size_t __pyx_v_itemsize) {
19131 CYTHON_UNUSED Py_ssize_t __pyx_v_i;
19132 CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent;
19133 Py_ssize_t __pyx_v_dst_extent;
19134 Py_ssize_t __pyx_v_src_stride;
19135 Py_ssize_t __pyx_v_dst_stride;
19139 Py_ssize_t __pyx_t_4;
19140 Py_ssize_t __pyx_t_5;
19141 Py_ssize_t __pyx_t_6;
19150 __pyx_v_src_extent = (__pyx_v_src_shape[0]);
19159 __pyx_v_dst_extent = (__pyx_v_dst_shape[0]);
19168 __pyx_v_src_stride = (__pyx_v_src_strides[0]);
19177 __pyx_v_dst_stride = (__pyx_v_dst_strides[0]);
19186 __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
19196 __pyx_t_2 = ((__pyx_v_src_stride > 0) != 0);
19199 __pyx_t_1 = __pyx_t_2;
19200 goto __pyx_L5_bool_binop_done;
19202 __pyx_t_2 = ((__pyx_v_dst_stride > 0) != 0);
19205 __pyx_t_1 = __pyx_t_2;
19206 goto __pyx_L5_bool_binop_done;
19216 __pyx_t_2 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize);
19218 __pyx_t_2 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride));
19220 __pyx_t_3 = (__pyx_t_2 != 0);
19221 __pyx_t_1 = __pyx_t_3;
19222 __pyx_L5_bool_binop_done:;
19240 (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent)));
19260 __pyx_t_4 = __pyx_v_dst_extent;
19261 __pyx_t_5 = __pyx_t_4;
19262 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
19263 __pyx_v_i = __pyx_t_6;
19272 (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize));
19281 __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
19290 __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
19313 __pyx_t_4 = __pyx_v_dst_extent;
19314 __pyx_t_5 = __pyx_t_4;
19315 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
19316 __pyx_v_i = __pyx_t_6;
19325 _copy_strided_to_strided(__pyx_v_src_data, (__pyx_v_src_strides + 1), __pyx_v_dst_data, (__pyx_v_dst_strides + 1), (__pyx_v_src_shape + 1), (__pyx_v_dst_shape + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize);
19334 __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
19343 __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
19367 static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_dst,
int __pyx_v_ndim,
size_t __pyx_v_itemsize) {
19376 _copy_strided_to_strided(__pyx_v_src->data, __pyx_v_src->strides, __pyx_v_dst->data, __pyx_v_dst->strides, __pyx_v_src->shape, __pyx_v_dst->shape, __pyx_v_ndim, __pyx_v_itemsize);
19397 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src,
int __pyx_v_ndim) {
19398 Py_ssize_t __pyx_v_shape;
19399 Py_ssize_t __pyx_v_size;
19400 Py_ssize_t __pyx_r;
19401 Py_ssize_t __pyx_t_1;
19402 Py_ssize_t *__pyx_t_2;
19403 Py_ssize_t *__pyx_t_3;
19404 Py_ssize_t *__pyx_t_4;
19413 __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
19414 __pyx_v_size = __pyx_t_1;
19423 __pyx_t_3 = (__pyx_v_src->shape + __pyx_v_ndim);
19424 for (__pyx_t_4 = __pyx_v_src->shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
19425 __pyx_t_2 = __pyx_t_4;
19426 __pyx_v_shape = (__pyx_t_2[0]);
19435 __pyx_v_size = (__pyx_v_size * __pyx_v_shape);
19445 __pyx_r = __pyx_v_size;
19469 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, Py_ssize_t __pyx_v_stride,
int __pyx_v_ndim,
char __pyx_v_order) {
19471 Py_ssize_t __pyx_r;
19484 __pyx_t_1 = ((__pyx_v_order ==
'F') != 0);
19494 __pyx_t_2 = __pyx_v_ndim;
19495 __pyx_t_3 = __pyx_t_2;
19496 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
19497 __pyx_v_idx = __pyx_t_4;
19506 (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
19515 __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
19536 for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) {
19537 __pyx_v_idx = __pyx_t_2;
19546 (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
19555 __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
19567 __pyx_r = __pyx_v_stride;
19591 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_tmpslice,
char __pyx_v_order,
int __pyx_v_ndim) {
19593 void *__pyx_v_result;
19594 size_t __pyx_v_itemsize;
19595 size_t __pyx_v_size;
19597 Py_ssize_t __pyx_t_1;
19600 struct __pyx_memoryview_obj *__pyx_t_4;
19603 int __pyx_lineno = 0;
19604 const char *__pyx_filename = NULL;
19605 int __pyx_clineno = 0;
19614 __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
19615 __pyx_v_itemsize = __pyx_t_1;
19624 __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim);
19633 __pyx_v_result = malloc(__pyx_v_size);
19642 __pyx_t_2 = ((!(__pyx_v_result != 0)) != 0);
19652 __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL);
if (unlikely(__pyx_t_3 == ((
int)-1))) __PYX_ERR(1, 1224, __pyx_L1_error)
19670 __pyx_v_tmpslice->data = ((
char *)__pyx_v_result);
19679 __pyx_t_4 = __pyx_v_src->memview;
19680 __pyx_v_tmpslice->memview = __pyx_t_4;
19689 __pyx_t_3 = __pyx_v_ndim;
19690 __pyx_t_5 = __pyx_t_3;
19691 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
19692 __pyx_v_i = __pyx_t_6;
19701 (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]);
19710 (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1
L;
19720 (void)(__pyx_fill_contig_strides_array((&(__pyx_v_tmpslice->shape[0])), (&(__pyx_v_tmpslice->strides[0])), __pyx_v_itemsize, __pyx_v_ndim, __pyx_v_order));
19729 __pyx_t_3 = __pyx_v_ndim;
19730 __pyx_t_5 = __pyx_t_3;
19731 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
19732 __pyx_v_i = __pyx_t_6;
19741 __pyx_t_2 = (((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1) != 0);
19751 (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0;
19770 __pyx_t_2 = (__pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim) != 0);
19780 (void)(memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size));
19800 copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize);
19811 __pyx_r = __pyx_v_result;
19826 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19828 __Pyx_AddTraceback(
"View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename);
19830 __Pyx_PyGILState_Release(__pyx_gilstate_save);
19846 static int __pyx_memoryview_err_extents(
int __pyx_v_i, Py_ssize_t __pyx_v_extent1, Py_ssize_t __pyx_v_extent2) {
19848 __Pyx_RefNannyDeclarations
19849 PyObject *__pyx_t_1 = NULL;
19850 PyObject *__pyx_t_2 = NULL;
19851 PyObject *__pyx_t_3 = NULL;
19852 PyObject *__pyx_t_4 = NULL;
19853 int __pyx_lineno = 0;
19854 const char *__pyx_filename = NULL;
19855 int __pyx_clineno = 0;
19857 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19859 __Pyx_RefNannySetupContext(
"_err_extents", 0);
19868 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1254, __pyx_L1_error)
19869 __Pyx_GOTREF(__pyx_t_1);
19870 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1254, __pyx_L1_error)
19871 __Pyx_GOTREF(__pyx_t_2);
19872 __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1254, __pyx_L1_error)
19873 __Pyx_GOTREF(__pyx_t_3);
19874 __pyx_t_4 = PyTuple_New(3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1254, __pyx_L1_error)
19875 __Pyx_GOTREF(__pyx_t_4);
19876 __Pyx_GIVEREF(__pyx_t_1);
19877 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
19878 __Pyx_GIVEREF(__pyx_t_2);
19879 PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
19880 __Pyx_GIVEREF(__pyx_t_3);
19881 PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
19893 __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1253, __pyx_L1_error)
19894 __Pyx_GOTREF(__pyx_t_3);
19895 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19896 __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1253, __pyx_L1_error)
19897 __Pyx_GOTREF(__pyx_t_4);
19898 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19899 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
19900 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19901 __PYX_ERR(1, 1253, __pyx_L1_error)
19913 __Pyx_XDECREF(__pyx_t_1);
19914 __Pyx_XDECREF(__pyx_t_2);
19915 __Pyx_XDECREF(__pyx_t_3);
19916 __Pyx_XDECREF(__pyx_t_4);
19917 __Pyx_AddTraceback(
"View.MemoryView._err_extents", __pyx_clineno, __pyx_lineno, __pyx_filename);
19919 __Pyx_RefNannyFinishContext();
19921 __Pyx_PyGILState_Release(__pyx_gilstate_save);
19934 static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error,
char *__pyx_v_msg,
int __pyx_v_dim) {
19936 __Pyx_RefNannyDeclarations
19937 PyObject *__pyx_t_1 = NULL;
19938 PyObject *__pyx_t_2 = NULL;
19939 PyObject *__pyx_t_3 = NULL;
19940 PyObject *__pyx_t_4 = NULL;
19941 int __pyx_lineno = 0;
19942 const char *__pyx_filename = NULL;
19943 int __pyx_clineno = 0;
19945 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19947 __Pyx_RefNannySetupContext(
"_err_dim", 0);
19948 __Pyx_INCREF(__pyx_v_error);
19957 __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1258, __pyx_L1_error)
19958 __Pyx_GOTREF(__pyx_t_2);
19959 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1258, __pyx_L1_error)
19960 __Pyx_GOTREF(__pyx_t_3);
19961 __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1258, __pyx_L1_error)
19962 __Pyx_GOTREF(__pyx_t_4);
19963 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19964 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19965 __Pyx_INCREF(__pyx_v_error);
19966 __pyx_t_3 = __pyx_v_error; __pyx_t_2 = NULL;
19967 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
19968 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
19969 if (likely(__pyx_t_2)) {
19970 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
19971 __Pyx_INCREF(__pyx_t_2);
19972 __Pyx_INCREF(
function);
19973 __Pyx_DECREF_SET(__pyx_t_3,
function);
19976 __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
19977 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
19978 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19979 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1258, __pyx_L1_error)
19980 __Pyx_GOTREF(__pyx_t_1);
19981 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19982 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
19983 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19984 __PYX_ERR(1, 1258, __pyx_L1_error)
19996 __Pyx_XDECREF(__pyx_t_1);
19997 __Pyx_XDECREF(__pyx_t_2);
19998 __Pyx_XDECREF(__pyx_t_3);
19999 __Pyx_XDECREF(__pyx_t_4);
20000 __Pyx_AddTraceback(
"View.MemoryView._err_dim", __pyx_clineno, __pyx_lineno, __pyx_filename);
20002 __Pyx_XDECREF(__pyx_v_error);
20003 __Pyx_RefNannyFinishContext();
20005 __Pyx_PyGILState_Release(__pyx_gilstate_save);
20018 static int __pyx_memoryview_err(PyObject *__pyx_v_error,
char *__pyx_v_msg) {
20020 __Pyx_RefNannyDeclarations
20022 PyObject *__pyx_t_2 = NULL;
20023 PyObject *__pyx_t_3 = NULL;
20024 PyObject *__pyx_t_4 = NULL;
20025 PyObject *__pyx_t_5 = NULL;
20026 int __pyx_lineno = 0;
20027 const char *__pyx_filename = NULL;
20028 int __pyx_clineno = 0;
20030 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
20032 __Pyx_RefNannySetupContext(
"_err", 0);
20033 __Pyx_INCREF(__pyx_v_error);
20042 __pyx_t_1 = ((__pyx_v_msg != NULL) != 0);
20043 if (unlikely(__pyx_t_1)) {
20052 __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1263, __pyx_L1_error)
20053 __Pyx_GOTREF(__pyx_t_3);
20054 __Pyx_INCREF(__pyx_v_error);
20055 __pyx_t_4 = __pyx_v_error; __pyx_t_5 = NULL;
20056 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
20057 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
20058 if (likely(__pyx_t_5)) {
20059 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_4);
20060 __Pyx_INCREF(__pyx_t_5);
20061 __Pyx_INCREF(
function);
20062 __Pyx_DECREF_SET(__pyx_t_4,
function);
20065 __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
20066 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
20067 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20068 if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1263, __pyx_L1_error)
20069 __Pyx_GOTREF(__pyx_t_2);
20070 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20071 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
20072 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20073 __PYX_ERR(1, 1263, __pyx_L1_error)
20092 __Pyx_Raise(__pyx_v_error, 0, 0, 0);
20093 __PYX_ERR(1, 1265, __pyx_L1_error)
20106 __Pyx_XDECREF(__pyx_t_2);
20107 __Pyx_XDECREF(__pyx_t_3);
20108 __Pyx_XDECREF(__pyx_t_4);
20109 __Pyx_XDECREF(__pyx_t_5);
20110 __Pyx_AddTraceback(
"View.MemoryView._err", __pyx_clineno, __pyx_lineno, __pyx_filename);
20112 __Pyx_XDECREF(__pyx_v_error);
20113 __Pyx_RefNannyFinishContext();
20115 __Pyx_PyGILState_Release(__pyx_gilstate_save);
20128 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_memviewslice __pyx_v_dst,
int __pyx_v_src_ndim,
int __pyx_v_dst_ndim,
int __pyx_v_dtype_is_object) {
20129 void *__pyx_v_tmpdata;
20130 size_t __pyx_v_itemsize;
20132 char __pyx_v_order;
20133 int __pyx_v_broadcasting;
20134 int __pyx_v_direct_copy;
20135 __Pyx_memviewslice __pyx_v_tmp;
20138 Py_ssize_t __pyx_t_1;
20146 int __pyx_lineno = 0;
20147 const char *__pyx_filename = NULL;
20148 int __pyx_clineno = 0;
20157 __pyx_v_tmpdata = NULL;
20166 __pyx_t_1 = __pyx_v_src.memview->view.itemsize;
20167 __pyx_v_itemsize = __pyx_t_1;
20176 __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim);
20185 __pyx_v_broadcasting = 0;
20194 __pyx_v_direct_copy = 0;
20203 __pyx_t_2 = ((__pyx_v_src_ndim < __pyx_v_dst_ndim) != 0);
20213 __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim);
20232 __pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0);
20242 __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim);
20261 __pyx_t_3 = __pyx_v_dst_ndim;
20262 __pyx_t_4 = __pyx_v_src_ndim;
20263 if (((__pyx_t_3 > __pyx_t_4) != 0)) {
20264 __pyx_t_5 = __pyx_t_3;
20266 __pyx_t_5 = __pyx_t_4;
20268 __pyx_v_ndim = __pyx_t_5;
20277 __pyx_t_5 = __pyx_v_ndim;
20278 __pyx_t_3 = __pyx_t_5;
20279 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
20280 __pyx_v_i = __pyx_t_4;
20289 __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i])) != 0);
20299 __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) == 1) != 0);
20309 __pyx_v_broadcasting = 1;
20318 (__pyx_v_src.strides[__pyx_v_i]) = 0;
20338 __pyx_t_6 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i]));
if (unlikely(__pyx_t_6 == ((
int)-1))) __PYX_ERR(1, 1297, __pyx_L1_error)
20358 __pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0);
20368 __pyx_t_6 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((
char *)
"Dimension %d is not direct"), __pyx_v_i);
if (unlikely(__pyx_t_6 == ((
int)-1))) __PYX_ERR(1, 1300, __pyx_L1_error)
20387 __pyx_t_2 = (__pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize) != 0);
20397 __pyx_t_2 = ((!(__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim) != 0)) != 0);
20407 __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim);
20425 __pyx_t_7 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim);
if (unlikely(__pyx_t_7 == ((
void *)NULL))) __PYX_ERR(1, 1307, __pyx_L1_error)
20426 __pyx_v_tmpdata = __pyx_t_7;
20435 __pyx_v_src = __pyx_v_tmp;
20453 __pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0);
20463 __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src,
'C', __pyx_v_ndim) != 0);
20473 __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst,
'C', __pyx_v_ndim);
20492 __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src,
'F', __pyx_v_ndim) != 0);
20502 __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst,
'F', __pyx_v_ndim);
20521 __pyx_t_2 = (__pyx_v_direct_copy != 0);
20531 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
20540 (void)(memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim)));
20549 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
20558 free(__pyx_v_tmpdata);
20595 __pyx_t_2 = (__pyx_v_order ==
'F');
20597 __pyx_t_2 = (
'F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim));
20599 __pyx_t_8 = (__pyx_t_2 != 0);
20609 __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src));
if (unlikely(__pyx_t_5 == ((
int)0))) __PYX_ERR(1, 1329, __pyx_L1_error)
20618 __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst));
if (unlikely(__pyx_t_5 == ((
int)0))) __PYX_ERR(1, 1330, __pyx_L1_error)
20636 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
20645 copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
20654 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
20663 free(__pyx_v_tmpdata);
20687 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
20689 __Pyx_AddTraceback(
"View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename);
20691 __Pyx_PyGILState_Release(__pyx_gilstate_save);
20707 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice,
int __pyx_v_ndim,
int __pyx_v_ndim_other) {
20709 int __pyx_v_offset;
20721 __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim);
20730 for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
20731 __pyx_v_i = __pyx_t_1;
20740 (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]);
20749 (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->strides[__pyx_v_i]);
20758 (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]);
20768 __pyx_t_1 = __pyx_v_offset;
20769 __pyx_t_2 = __pyx_t_1;
20770 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
20771 __pyx_v_i = __pyx_t_3;
20780 (__pyx_v_mslice->shape[__pyx_v_i]) = 1;
20789 (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]);
20798 (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1
L;
20820 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst,
int __pyx_v_dtype_is_object,
int __pyx_v_ndim,
int __pyx_v_inc) {
20830 __pyx_t_1 = (__pyx_v_dtype_is_object != 0);
20840 __pyx_memoryview_refcount_objects_in_slice_with_gil(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_inc);
20870 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(
char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides,
int __pyx_v_ndim,
int __pyx_v_inc) {
20871 __Pyx_RefNannyDeclarations
20873 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
20875 __Pyx_RefNannySetupContext(
"refcount_objects_in_slice_with_gil", 0);
20884 __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc);
20895 __Pyx_RefNannyFinishContext();
20897 __Pyx_PyGILState_Release(__pyx_gilstate_save);
20909 static void __pyx_memoryview_refcount_objects_in_slice(
char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides,
int __pyx_v_ndim,
int __pyx_v_inc) {
20910 CYTHON_UNUSED Py_ssize_t __pyx_v_i;
20911 __Pyx_RefNannyDeclarations
20912 Py_ssize_t __pyx_t_1;
20913 Py_ssize_t __pyx_t_2;
20914 Py_ssize_t __pyx_t_3;
20916 __Pyx_RefNannySetupContext(
"refcount_objects_in_slice", 0);
20925 __pyx_t_1 = (__pyx_v_shape[0]);
20926 __pyx_t_2 = __pyx_t_1;
20927 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
20928 __pyx_v_i = __pyx_t_3;
20937 __pyx_t_4 = ((__pyx_v_ndim == 1) != 0);
20947 __pyx_t_4 = (__pyx_v_inc != 0);
20957 Py_INCREF((((PyObject **)__pyx_v_data)[0]));
20977 Py_DECREF((((PyObject **)__pyx_v_data)[0]));
21007 __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc);
21018 __pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0]));
21030 __Pyx_RefNannyFinishContext();
21041 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst,
int __pyx_v_ndim,
size_t __pyx_v_itemsize,
void *__pyx_v_item,
int __pyx_v_dtype_is_object) {
21050 __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
21059 __pyx_memoryview__slice_assign_scalar(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_itemsize, __pyx_v_item);
21068 __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
21089 static void __pyx_memoryview__slice_assign_scalar(
char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides,
int __pyx_v_ndim,
size_t __pyx_v_itemsize,
void *__pyx_v_item) {
21090 CYTHON_UNUSED Py_ssize_t __pyx_v_i;
21091 Py_ssize_t __pyx_v_stride;
21092 Py_ssize_t __pyx_v_extent;
21094 Py_ssize_t __pyx_t_2;
21095 Py_ssize_t __pyx_t_3;
21096 Py_ssize_t __pyx_t_4;
21105 __pyx_v_stride = (__pyx_v_strides[0]);
21114 __pyx_v_extent = (__pyx_v_shape[0]);
21123 __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
21133 __pyx_t_2 = __pyx_v_extent;
21134 __pyx_t_3 = __pyx_t_2;
21135 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
21136 __pyx_v_i = __pyx_t_4;
21145 (void)(memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize));
21154 __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
21175 __pyx_t_2 = __pyx_v_extent;
21176 __pyx_t_3 = __pyx_t_2;
21177 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
21178 __pyx_v_i = __pyx_t_4;
21187 __pyx_memoryview__slice_assign_scalar(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize, __pyx_v_item);
21196 __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
21219 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
21220 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum = {
"__pyx_unpickle_Enum", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum, METH_VARARGS|METH_KEYWORDS, 0};
21221 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
21222 PyObject *__pyx_v___pyx_type = 0;
21223 long __pyx_v___pyx_checksum;
21224 PyObject *__pyx_v___pyx_state = 0;
21225 int __pyx_lineno = 0;
21226 const char *__pyx_filename = NULL;
21227 int __pyx_clineno = 0;
21228 PyObject *__pyx_r = 0;
21229 __Pyx_RefNannyDeclarations
21230 __Pyx_RefNannySetupContext(
"__pyx_unpickle_Enum (wrapper)", 0);
21232 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
21233 PyObject* values[3] = {0,0,0};
21234 if (unlikely(__pyx_kwds)) {
21235 Py_ssize_t kw_args;
21236 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
21237 switch (pos_args) {
21238 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
21239 CYTHON_FALLTHROUGH;
21240 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
21241 CYTHON_FALLTHROUGH;
21242 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
21243 CYTHON_FALLTHROUGH;
21245 default:
goto __pyx_L5_argtuple_error;
21247 kw_args = PyDict_Size(__pyx_kwds);
21248 switch (pos_args) {
21250 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
21251 else goto __pyx_L5_argtuple_error;
21252 CYTHON_FALLTHROUGH;
21254 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
21256 __Pyx_RaiseArgtupleInvalid(
"__pyx_unpickle_Enum", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
21258 CYTHON_FALLTHROUGH;
21260 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
21262 __Pyx_RaiseArgtupleInvalid(
"__pyx_unpickle_Enum", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
21265 if (unlikely(kw_args > 0)) {
21266 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__pyx_unpickle_Enum") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
21268 }
else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
21269 goto __pyx_L5_argtuple_error;
21271 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
21272 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
21273 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
21275 __pyx_v___pyx_type = values[0];
21276 __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]);
if (unlikely((__pyx_v___pyx_checksum == (
long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
21277 __pyx_v___pyx_state = values[2];
21279 goto __pyx_L4_argument_unpacking_done;
21280 __pyx_L5_argtuple_error:;
21281 __Pyx_RaiseArgtupleInvalid(
"__pyx_unpickle_Enum", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error)
21283 __Pyx_AddTraceback(
"View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
21284 __Pyx_RefNannyFinishContext();
21286 __pyx_L4_argument_unpacking_done:;
21287 __pyx_r = __pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
21290 __Pyx_RefNannyFinishContext();
21294 static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type,
long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
21295 PyObject *__pyx_v___pyx_PickleError = 0;
21296 PyObject *__pyx_v___pyx_result = 0;
21297 PyObject *__pyx_r = NULL;
21298 __Pyx_RefNannyDeclarations
21300 PyObject *__pyx_t_2 = NULL;
21301 PyObject *__pyx_t_3 = NULL;
21302 PyObject *__pyx_t_4 = NULL;
21303 PyObject *__pyx_t_5 = NULL;
21305 int __pyx_lineno = 0;
21306 const char *__pyx_filename = NULL;
21307 int __pyx_clineno = 0;
21308 __Pyx_RefNannySetupContext(
"__pyx_unpickle_Enum", 0);
21317 __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xb068931) != 0);
21327 __pyx_t_2 = PyList_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
21328 __Pyx_GOTREF(__pyx_t_2);
21329 __Pyx_INCREF(__pyx_n_s_PickleError);
21330 __Pyx_GIVEREF(__pyx_n_s_PickleError);
21331 PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
21332 __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
21333 __Pyx_GOTREF(__pyx_t_3);
21334 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21335 __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
21336 __Pyx_GOTREF(__pyx_t_2);
21337 __Pyx_INCREF(__pyx_t_2);
21338 __pyx_v___pyx_PickleError = __pyx_t_2;
21339 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21340 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21349 __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error)
21350 __Pyx_GOTREF(__pyx_t_2);
21351 __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0xb0, __pyx_t_2);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
21352 __Pyx_GOTREF(__pyx_t_4);
21353 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21354 __Pyx_INCREF(__pyx_v___pyx_PickleError);
21355 __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
21356 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
21357 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
21358 if (likely(__pyx_t_5)) {
21359 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
21360 __Pyx_INCREF(__pyx_t_5);
21361 __Pyx_INCREF(
function);
21362 __Pyx_DECREF_SET(__pyx_t_2,
function);
21365 __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
21366 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
21367 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21368 if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error)
21369 __Pyx_GOTREF(__pyx_t_3);
21370 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21371 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
21372 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21373 __PYX_ERR(1, 6, __pyx_L1_error)
21391 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_MemviewEnum_type), __pyx_n_s_new);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error)
21392 __Pyx_GOTREF(__pyx_t_2);
21394 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
21395 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
21396 if (likely(__pyx_t_4)) {
21397 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
21398 __Pyx_INCREF(__pyx_t_4);
21399 __Pyx_INCREF(
function);
21400 __Pyx_DECREF_SET(__pyx_t_2,
function);
21403 __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type);
21404 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
21405 if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error)
21406 __Pyx_GOTREF(__pyx_t_3);
21407 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21408 __pyx_v___pyx_result = __pyx_t_3;
21418 __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
21419 __pyx_t_6 = (__pyx_t_1 != 0);
21429 if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error)
21430 __pyx_t_3 = __pyx_unpickle_Enum__set_state(((
struct __pyx_MemviewEnum_obj *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state));
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 9, __pyx_L1_error)
21431 __Pyx_GOTREF(__pyx_t_3);
21432 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21450 __Pyx_XDECREF(__pyx_r);
21451 __Pyx_INCREF(__pyx_v___pyx_result);
21452 __pyx_r = __pyx_v___pyx_result;
21463 __Pyx_XDECREF(__pyx_t_2);
21464 __Pyx_XDECREF(__pyx_t_3);
21465 __Pyx_XDECREF(__pyx_t_4);
21466 __Pyx_XDECREF(__pyx_t_5);
21467 __Pyx_AddTraceback(
"View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
21470 __Pyx_XDECREF(__pyx_v___pyx_PickleError);
21471 __Pyx_XDECREF(__pyx_v___pyx_result);
21472 __Pyx_XGIVEREF(__pyx_r);
21473 __Pyx_RefNannyFinishContext();
21485 static PyObject *__pyx_unpickle_Enum__set_state(
struct __pyx_MemviewEnum_obj *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
21486 PyObject *__pyx_r = NULL;
21487 __Pyx_RefNannyDeclarations
21488 PyObject *__pyx_t_1 = NULL;
21490 Py_ssize_t __pyx_t_3;
21493 PyObject *__pyx_t_6 = NULL;
21494 PyObject *__pyx_t_7 = NULL;
21495 PyObject *__pyx_t_8 = NULL;
21496 int __pyx_lineno = 0;
21497 const char *__pyx_filename = NULL;
21498 int __pyx_clineno = 0;
21499 __Pyx_RefNannySetupContext(
"__pyx_unpickle_Enum__set_state", 0);
21508 if (unlikely(__pyx_v___pyx_state == Py_None)) {
21509 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
21510 __PYX_ERR(1, 12, __pyx_L1_error)
21512 __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
21513 __Pyx_GOTREF(__pyx_t_1);
21514 __Pyx_GIVEREF(__pyx_t_1);
21515 __Pyx_GOTREF(__pyx_v___pyx_result->name);
21516 __Pyx_DECREF(__pyx_v___pyx_result->name);
21517 __pyx_v___pyx_result->name = __pyx_t_1;
21526 if (unlikely(__pyx_v___pyx_state == Py_None)) {
21527 PyErr_SetString(PyExc_TypeError,
"object of type 'NoneType' has no len()");
21528 __PYX_ERR(1, 13, __pyx_L1_error)
21530 __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state);
if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
21531 __pyx_t_4 = ((__pyx_t_3 > 1) != 0);
21534 __pyx_t_2 = __pyx_t_4;
21535 goto __pyx_L4_bool_binop_done;
21537 __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict);
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
21538 __pyx_t_5 = (__pyx_t_4 != 0);
21539 __pyx_t_2 = __pyx_t_5;
21540 __pyx_L4_bool_binop_done:;
21548 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error)
21549 __Pyx_GOTREF(__pyx_t_6);
21550 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error)
21551 __Pyx_GOTREF(__pyx_t_7);
21552 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21553 if (unlikely(__pyx_v___pyx_state == Py_None)) {
21554 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
21555 __PYX_ERR(1, 14, __pyx_L1_error)
21557 __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error)
21558 __Pyx_GOTREF(__pyx_t_6);
21560 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
21561 __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
21562 if (likely(__pyx_t_8)) {
21563 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_7);
21564 __Pyx_INCREF(__pyx_t_8);
21565 __Pyx_INCREF(
function);
21566 __Pyx_DECREF_SET(__pyx_t_7,
function);
21569 __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6);
21570 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
21571 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21572 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
21573 __Pyx_GOTREF(__pyx_t_1);
21574 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
21575 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21594 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
21597 __Pyx_XDECREF(__pyx_t_1);
21598 __Pyx_XDECREF(__pyx_t_6);
21599 __Pyx_XDECREF(__pyx_t_7);
21600 __Pyx_XDECREF(__pyx_t_8);
21601 __Pyx_AddTraceback(
"View.MemoryView.__pyx_unpickle_Enum__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
21604 __Pyx_XGIVEREF(__pyx_r);
21605 __Pyx_RefNannyFinishContext();
21609 static PyObject *__pyx_tp_new_10csmoothers_cASMFactor(PyTypeObject *t, PyObject *a, PyObject *k) {
21611 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
21612 o = (*t->tp_alloc)(t, 0);
21614 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
21616 if (unlikely(!o))
return 0;
21617 if (unlikely(__pyx_pw_10csmoothers_10cASMFactor_1__cinit__(o, a, k) < 0))
goto bad;
21620 Py_DECREF(o); o = 0;
21624 static void __pyx_tp_dealloc_10csmoothers_cASMFactor(PyObject *o) {
21625 #if CYTHON_USE_TP_FINALIZE
21626 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
21627 if (PyObject_CallFinalizerFromDealloc(o))
return;
21631 PyObject *etype, *eval, *etb;
21632 PyErr_Fetch(&etype, &eval, &etb);
21633 __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
21634 __pyx_pw_10csmoothers_10cASMFactor_3__dealloc__(o);
21635 __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
21636 PyErr_Restore(etype, eval, etb);
21638 (*Py_TYPE(o)->tp_free)(o);
21641 static PyMethodDef __pyx_methods_10csmoothers_cASMFactor[] = {
21642 {
"__reduce_cython__", (PyCFunction)__pyx_pw_10csmoothers_10cASMFactor_5__reduce_cython__, METH_NOARGS, 0},
21643 {
"__setstate_cython__", (PyCFunction)__pyx_pw_10csmoothers_10cASMFactor_7__setstate_cython__, METH_O, 0},
21647 static PyTypeObject __pyx_type_10csmoothers_cASMFactor = {
21648 PyVarObject_HEAD_INIT(0, 0)
21649 "csmoothers.cASMFactor",
21650 sizeof(
struct __pyx_obj_10csmoothers_cASMFactor),
21652 __pyx_tp_dealloc_10csmoothers_cASMFactor,
21653 #
if PY_VERSION_HEX < 0x030800b4
21656 #
if PY_VERSION_HEX >= 0x030800b4
21661 #
if PY_MAJOR_VERSION < 3
21664 #
if PY_MAJOR_VERSION >= 3
21677 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
21685 __pyx_methods_10csmoothers_cASMFactor,
21695 __pyx_tp_new_10csmoothers_cASMFactor,
21705 #
if PY_VERSION_HEX >= 0x030400a1
21708 #
if PY_VERSION_HEX >= 0x030800b1
21711 #
if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
21716 static PyObject *__pyx_tp_new_10csmoothers_cBASMFactor(PyTypeObject *t, PyObject *a, PyObject *k) {
21718 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
21719 o = (*t->tp_alloc)(t, 0);
21721 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
21723 if (unlikely(!o))
return 0;
21724 if (unlikely(__pyx_pw_10csmoothers_11cBASMFactor_1__cinit__(o, a, k) < 0))
goto bad;
21727 Py_DECREF(o); o = 0;
21731 static void __pyx_tp_dealloc_10csmoothers_cBASMFactor(PyObject *o) {
21732 #if CYTHON_USE_TP_FINALIZE
21733 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
21734 if (PyObject_CallFinalizerFromDealloc(o))
return;
21738 PyObject *etype, *eval, *etb;
21739 PyErr_Fetch(&etype, &eval, &etb);
21740 __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
21741 __pyx_pw_10csmoothers_11cBASMFactor_3__dealloc__(o);
21742 __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
21743 PyErr_Restore(etype, eval, etb);
21745 (*Py_TYPE(o)->tp_free)(o);
21748 static PyMethodDef __pyx_methods_10csmoothers_cBASMFactor[] = {
21749 {
"__reduce_cython__", (PyCFunction)__pyx_pw_10csmoothers_11cBASMFactor_5__reduce_cython__, METH_NOARGS, 0},
21750 {
"__setstate_cython__", (PyCFunction)__pyx_pw_10csmoothers_11cBASMFactor_7__setstate_cython__, METH_O, 0},
21754 static PyTypeObject __pyx_type_10csmoothers_cBASMFactor = {
21755 PyVarObject_HEAD_INIT(0, 0)
21756 "csmoothers.cBASMFactor",
21757 sizeof(
struct __pyx_obj_10csmoothers_cBASMFactor),
21759 __pyx_tp_dealloc_10csmoothers_cBASMFactor,
21760 #
if PY_VERSION_HEX < 0x030800b4
21763 #
if PY_VERSION_HEX >= 0x030800b4
21768 #
if PY_MAJOR_VERSION < 3
21771 #
if PY_MAJOR_VERSION >= 3
21784 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
21792 __pyx_methods_10csmoothers_cBASMFactor,
21802 __pyx_tp_new_10csmoothers_cBASMFactor,
21812 #
if PY_VERSION_HEX >= 0x030400a1
21815 #
if PY_VERSION_HEX >= 0x030800b1
21818 #
if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
21822 static struct __pyx_vtabstruct_array __pyx_vtable_array;
21824 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
21825 struct __pyx_array_obj *p;
21827 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
21828 o = (*t->tp_alloc)(t, 0);
21830 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
21832 if (unlikely(!o))
return 0;
21833 p = ((
struct __pyx_array_obj *)o);
21834 p->__pyx_vtab = __pyx_vtabptr_array;
21835 p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None);
21836 p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None);
21837 if (unlikely(__pyx_array___cinit__(o, a, k) < 0))
goto bad;
21840 Py_DECREF(o); o = 0;
21844 static void __pyx_tp_dealloc_array(PyObject *o) {
21845 struct __pyx_array_obj *p = (
struct __pyx_array_obj *)o;
21846 #if CYTHON_USE_TP_FINALIZE
21847 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
21848 if (PyObject_CallFinalizerFromDealloc(o))
return;
21852 PyObject *etype, *eval, *etb;
21853 PyErr_Fetch(&etype, &eval, &etb);
21854 __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
21855 __pyx_array___dealloc__(o);
21856 __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
21857 PyErr_Restore(etype, eval, etb);
21860 Py_CLEAR(p->_format);
21861 (*Py_TYPE(o)->tp_free)(o);
21863 static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) {
21865 PyObject *x = PyInt_FromSsize_t(i);
if(!x)
return 0;
21866 r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
21871 static int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *
v) {
21873 return __pyx_array___setitem__(o, i,
v);
21876 PyErr_Format(PyExc_NotImplementedError,
21877 "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
21882 static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *
n) {
21883 PyObject *
v = __Pyx_PyObject_GenericGetAttr(o,
n);
21884 if (!
v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
21886 v = __pyx_array___getattr__(o,
n);
21891 static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED
void *x) {
21892 return __pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(o);
21895 static PyMethodDef __pyx_methods_array[] = {
21896 {
"__getattr__", (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, 0},
21897 {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_array_1__reduce_cython__, METH_NOARGS, 0},
21898 {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_array_3__setstate_cython__, METH_O, 0},
21902 static struct PyGetSetDef __pyx_getsets_array[] = {
21903 {(
char *)
"memview", __pyx_getprop___pyx_array_memview, 0, (
char *)0, 0},
21907 static PySequenceMethods __pyx_tp_as_sequence_array = {
21908 __pyx_array___len__,
21911 __pyx_sq_item_array,
21920 static PyMappingMethods __pyx_tp_as_mapping_array = {
21921 __pyx_array___len__,
21922 __pyx_array___getitem__,
21923 __pyx_mp_ass_subscript_array,
21926 static PyBufferProcs __pyx_tp_as_buffer_array = {
21927 #if PY_MAJOR_VERSION < 3
21930 #if PY_MAJOR_VERSION < 3
21933 #if PY_MAJOR_VERSION < 3
21936 #if PY_MAJOR_VERSION < 3
21939 __pyx_array_getbuffer,
21943 static PyTypeObject __pyx_type___pyx_array = {
21944 PyVarObject_HEAD_INIT(0, 0)
21945 "csmoothers.array",
21946 sizeof(
struct __pyx_array_obj),
21948 __pyx_tp_dealloc_array,
21949 #
if PY_VERSION_HEX < 0x030800b4
21952 #
if PY_VERSION_HEX >= 0x030800b4
21957 #
if PY_MAJOR_VERSION < 3
21960 #
if PY_MAJOR_VERSION >= 3
21965 &__pyx_tp_as_sequence_array,
21966 &__pyx_tp_as_mapping_array,
21970 __pyx_tp_getattro_array,
21972 &__pyx_tp_as_buffer_array,
21973 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
21981 __pyx_methods_array,
21983 __pyx_getsets_array,
21991 __pyx_tp_new_array,
22001 #
if PY_VERSION_HEX >= 0x030400a1
22004 #
if PY_VERSION_HEX >= 0x030800b1
22007 #
if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
22012 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
22013 struct __pyx_MemviewEnum_obj *p;
22015 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
22016 o = (*t->tp_alloc)(t, 0);
22018 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
22020 if (unlikely(!o))
return 0;
22021 p = ((
struct __pyx_MemviewEnum_obj *)o);
22022 p->name = Py_None; Py_INCREF(Py_None);
22026 static void __pyx_tp_dealloc_Enum(PyObject *o) {
22027 struct __pyx_MemviewEnum_obj *p = (
struct __pyx_MemviewEnum_obj *)o;
22028 #if CYTHON_USE_TP_FINALIZE
22029 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
22030 if (PyObject_CallFinalizerFromDealloc(o))
return;
22033 PyObject_GC_UnTrack(o);
22035 (*Py_TYPE(o)->tp_free)(o);
22038 static int __pyx_tp_traverse_Enum(PyObject *o, visitproc
v,
void *a) {
22040 struct __pyx_MemviewEnum_obj *p = (
struct __pyx_MemviewEnum_obj *)o;
22042 e = (*v)(p->name, a);
if (e)
return e;
22047 static int __pyx_tp_clear_Enum(PyObject *o) {
22049 struct __pyx_MemviewEnum_obj *p = (
struct __pyx_MemviewEnum_obj *)o;
22050 tmp = ((PyObject*)p->name);
22051 p->name = Py_None; Py_INCREF(Py_None);
22056 static PyMethodDef __pyx_methods_Enum[] = {
22057 {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, METH_NOARGS, 0},
22058 {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, METH_O, 0},
22062 static PyTypeObject __pyx_type___pyx_MemviewEnum = {
22063 PyVarObject_HEAD_INIT(0, 0)
22065 sizeof(
struct __pyx_MemviewEnum_obj),
22067 __pyx_tp_dealloc_Enum,
22068 #
if PY_VERSION_HEX < 0x030800b4
22071 #
if PY_VERSION_HEX >= 0x030800b4
22076 #
if PY_MAJOR_VERSION < 3
22079 #
if PY_MAJOR_VERSION >= 3
22082 __pyx_MemviewEnum___repr__,
22092 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
22094 __pyx_tp_traverse_Enum,
22095 __pyx_tp_clear_Enum,
22100 __pyx_methods_Enum,
22108 __pyx_MemviewEnum___init__,
22120 #
if PY_VERSION_HEX >= 0x030400a1
22123 #
if PY_VERSION_HEX >= 0x030800b1
22126 #
if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
22130 static struct __pyx_vtabstruct_memoryview __pyx_vtable_memoryview;
22132 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k) {
22133 struct __pyx_memoryview_obj *p;
22135 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
22136 o = (*t->tp_alloc)(t, 0);
22138 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
22140 if (unlikely(!o))
return 0;
22141 p = ((
struct __pyx_memoryview_obj *)o);
22142 p->__pyx_vtab = __pyx_vtabptr_memoryview;
22143 p->obj = Py_None; Py_INCREF(Py_None);
22144 p->_size = Py_None; Py_INCREF(Py_None);
22145 p->_array_interface = Py_None; Py_INCREF(Py_None);
22146 p->view.obj = NULL;
22147 if (unlikely(__pyx_memoryview___cinit__(o, a, k) < 0))
goto bad;
22150 Py_DECREF(o); o = 0;
22154 static void __pyx_tp_dealloc_memoryview(PyObject *o) {
22155 struct __pyx_memoryview_obj *p = (
struct __pyx_memoryview_obj *)o;
22156 #if CYTHON_USE_TP_FINALIZE
22157 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
22158 if (PyObject_CallFinalizerFromDealloc(o))
return;
22161 PyObject_GC_UnTrack(o);
22163 PyObject *etype, *eval, *etb;
22164 PyErr_Fetch(&etype, &eval, &etb);
22165 __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
22166 __pyx_memoryview___dealloc__(o);
22167 __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
22168 PyErr_Restore(etype, eval, etb);
22171 Py_CLEAR(p->_size);
22172 Py_CLEAR(p->_array_interface);
22173 (*Py_TYPE(o)->tp_free)(o);
22176 static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc
v,
void *a) {
22178 struct __pyx_memoryview_obj *p = (
struct __pyx_memoryview_obj *)o;
22180 e = (*v)(p->obj, a);
if (e)
return e;
22183 e = (*v)(p->_size, a);
if (e)
return e;
22185 if (p->_array_interface) {
22186 e = (*v)(p->_array_interface, a);
if (e)
return e;
22189 e = (*v)(p->view.obj, a);
if (e)
return e;
22194 static int __pyx_tp_clear_memoryview(PyObject *o) {
22196 struct __pyx_memoryview_obj *p = (
struct __pyx_memoryview_obj *)o;
22197 tmp = ((PyObject*)p->obj);
22198 p->obj = Py_None; Py_INCREF(Py_None);
22200 tmp = ((PyObject*)p->_size);
22201 p->_size = Py_None; Py_INCREF(Py_None);
22203 tmp = ((PyObject*)p->_array_interface);
22204 p->_array_interface = Py_None; Py_INCREF(Py_None);
22206 Py_CLEAR(p->view.obj);
22209 static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) {
22211 PyObject *x = PyInt_FromSsize_t(i);
if(!x)
return 0;
22212 r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
22217 static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject *
v) {
22219 return __pyx_memoryview___setitem__(o, i,
v);
22222 PyErr_Format(PyExc_NotImplementedError,
22223 "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
22228 static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED
void *x) {
22229 return __pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(o);
22232 static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED
void *x) {
22233 return __pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(o);
22236 static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED
void *x) {
22237 return __pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(o);
22240 static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED
void *x) {
22241 return __pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(o);
22244 static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED
void *x) {
22245 return __pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(o);
22248 static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED
void *x) {
22249 return __pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(o);
22252 static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED
void *x) {
22253 return __pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(o);
22256 static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED
void *x) {
22257 return __pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(o);
22260 static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED
void *x) {
22261 return __pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(o);
22264 static PyMethodDef __pyx_methods_memoryview[] = {
22265 {
"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0},
22266 {
"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0},
22267 {
"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0},
22268 {
"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0},
22269 {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_1__reduce_cython__, METH_NOARGS, 0},
22270 {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_3__setstate_cython__, METH_O, 0},
22274 static struct PyGetSetDef __pyx_getsets_memoryview[] = {
22275 {(
char *)
"T", __pyx_getprop___pyx_memoryview_T, 0, (
char *)0, 0},
22276 {(
char *)
"base", __pyx_getprop___pyx_memoryview_base, 0, (
char *)0, 0},
22277 {(
char *)
"shape", __pyx_getprop___pyx_memoryview_shape, 0, (
char *)0, 0},
22278 {(
char *)
"strides", __pyx_getprop___pyx_memoryview_strides, 0, (
char *)0, 0},
22279 {(
char *)
"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, (
char *)0, 0},
22280 {(
char *)
"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, (
char *)0, 0},
22281 {(
char *)
"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, (
char *)0, 0},
22282 {(
char *)
"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, (
char *)0, 0},
22283 {(
char *)
"size", __pyx_getprop___pyx_memoryview_size, 0, (
char *)0, 0},
22287 static PySequenceMethods __pyx_tp_as_sequence_memoryview = {
22288 __pyx_memoryview___len__,
22291 __pyx_sq_item_memoryview,
22300 static PyMappingMethods __pyx_tp_as_mapping_memoryview = {
22301 __pyx_memoryview___len__,
22302 __pyx_memoryview___getitem__,
22303 __pyx_mp_ass_subscript_memoryview,
22306 static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
22307 #if PY_MAJOR_VERSION < 3
22310 #if PY_MAJOR_VERSION < 3
22313 #if PY_MAJOR_VERSION < 3
22316 #if PY_MAJOR_VERSION < 3
22319 __pyx_memoryview_getbuffer,
22323 static PyTypeObject __pyx_type___pyx_memoryview = {
22324 PyVarObject_HEAD_INIT(0, 0)
22325 "csmoothers.memoryview",
22326 sizeof(
struct __pyx_memoryview_obj),
22328 __pyx_tp_dealloc_memoryview,
22329 #
if PY_VERSION_HEX < 0x030800b4
22332 #
if PY_VERSION_HEX >= 0x030800b4
22337 #
if PY_MAJOR_VERSION < 3
22340 #
if PY_MAJOR_VERSION >= 3
22343 __pyx_memoryview___repr__,
22345 &__pyx_tp_as_sequence_memoryview,
22346 &__pyx_tp_as_mapping_memoryview,
22349 __pyx_memoryview___str__,
22352 &__pyx_tp_as_buffer_memoryview,
22353 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
22355 __pyx_tp_traverse_memoryview,
22356 __pyx_tp_clear_memoryview,
22361 __pyx_methods_memoryview,
22363 __pyx_getsets_memoryview,
22371 __pyx_tp_new_memoryview,
22381 #
if PY_VERSION_HEX >= 0x030400a1
22384 #
if PY_VERSION_HEX >= 0x030800b1
22387 #
if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
22391 static struct __pyx_vtabstruct__memoryviewslice __pyx_vtable__memoryviewslice;
22393 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k) {
22394 struct __pyx_memoryviewslice_obj *p;
22395 PyObject *o = __pyx_tp_new_memoryview(t, a, k);
22396 if (unlikely(!o))
return 0;
22397 p = ((
struct __pyx_memoryviewslice_obj *)o);
22398 p->__pyx_base.__pyx_vtab = (
struct __pyx_vtabstruct_memoryview*)__pyx_vtabptr__memoryviewslice;
22399 p->from_object = Py_None; Py_INCREF(Py_None);
22400 p->from_slice.memview = NULL;
22404 static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) {
22405 struct __pyx_memoryviewslice_obj *p = (
struct __pyx_memoryviewslice_obj *)o;
22406 #if CYTHON_USE_TP_FINALIZE
22407 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
22408 if (PyObject_CallFinalizerFromDealloc(o))
return;
22411 PyObject_GC_UnTrack(o);
22413 PyObject *etype, *eval, *etb;
22414 PyErr_Fetch(&etype, &eval, &etb);
22415 __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
22416 __pyx_memoryviewslice___dealloc__(o);
22417 __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
22418 PyErr_Restore(etype, eval, etb);
22420 Py_CLEAR(p->from_object);
22421 PyObject_GC_Track(o);
22422 __pyx_tp_dealloc_memoryview(o);
22425 static int __pyx_tp_traverse__memoryviewslice(PyObject *o, visitproc
v,
void *a) {
22427 struct __pyx_memoryviewslice_obj *p = (
struct __pyx_memoryviewslice_obj *)o;
22428 e = __pyx_tp_traverse_memoryview(o,
v, a);
if (e)
return e;
22429 if (p->from_object) {
22430 e = (*v)(p->from_object, a);
if (e)
return e;
22435 static int __pyx_tp_clear__memoryviewslice(PyObject *o) {
22437 struct __pyx_memoryviewslice_obj *p = (
struct __pyx_memoryviewslice_obj *)o;
22438 __pyx_tp_clear_memoryview(o);
22439 tmp = ((PyObject*)p->from_object);
22440 p->from_object = Py_None; Py_INCREF(Py_None);
22442 __PYX_XDEC_MEMVIEW(&p->from_slice, 1);
22446 static PyObject *__pyx_getprop___pyx_memoryviewslice_base(PyObject *o, CYTHON_UNUSED
void *x) {
22447 return __pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(o);
22450 static PyMethodDef __pyx_methods__memoryviewslice[] = {
22451 {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, METH_NOARGS, 0},
22452 {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, METH_O, 0},
22456 static struct PyGetSetDef __pyx_getsets__memoryviewslice[] = {
22457 {(
char *)
"base", __pyx_getprop___pyx_memoryviewslice_base, 0, (
char *)0, 0},
22461 static PyTypeObject __pyx_type___pyx_memoryviewslice = {
22462 PyVarObject_HEAD_INIT(0, 0)
22463 "csmoothers._memoryviewslice",
22464 sizeof(
struct __pyx_memoryviewslice_obj),
22466 __pyx_tp_dealloc__memoryviewslice,
22467 #
if PY_VERSION_HEX < 0x030800b4
22470 #
if PY_VERSION_HEX >= 0x030800b4
22475 #
if PY_MAJOR_VERSION < 3
22478 #
if PY_MAJOR_VERSION >= 3
22481 #
if CYTHON_COMPILING_IN_PYPY
22482 __pyx_memoryview___repr__,
22491 #
if CYTHON_COMPILING_IN_PYPY
22492 __pyx_memoryview___str__,
22499 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
22500 "Internal class for passing memoryview slices to Python",
22501 __pyx_tp_traverse__memoryviewslice,
22502 __pyx_tp_clear__memoryviewslice,
22507 __pyx_methods__memoryviewslice,
22509 __pyx_getsets__memoryviewslice,
22517 __pyx_tp_new__memoryviewslice,
22527 #
if PY_VERSION_HEX >= 0x030400a1
22530 #
if PY_VERSION_HEX >= 0x030800b1
22533 #
if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
22538 static PyMethodDef __pyx_methods[] = {
22542 #if PY_MAJOR_VERSION >= 3
22543 #if CYTHON_PEP489_MULTI_PHASE_INIT
22544 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def);
22545 static int __pyx_pymod_exec_csmoothers(PyObject* module);
22546 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
22547 {Py_mod_create, (
void*)__pyx_pymod_create},
22548 {Py_mod_exec, (
void*)__pyx_pymod_exec_csmoothers},
22553 static struct PyModuleDef __pyx_moduledef = {
22554 PyModuleDef_HEAD_INIT,
22557 #if CYTHON_PEP489_MULTI_PHASE_INIT
22563 #if CYTHON_PEP489_MULTI_PHASE_INIT
22564 __pyx_moduledef_slots,
22573 #ifndef CYTHON_SMALL_CODE
22574 #if defined(__clang__)
22575 #define CYTHON_SMALL_CODE
22576 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
22577 #define CYTHON_SMALL_CODE __attribute__((cold))
22579 #define CYTHON_SMALL_CODE
22583 static __Pyx_StringTabEntry __pyx_string_tab[] = {
22584 {&__pyx_n_s_A, __pyx_k_A,
sizeof(__pyx_k_A), 0, 0, 1, 1},
22585 {&__pyx_n_s_ASCII, __pyx_k_ASCII,
sizeof(__pyx_k_ASCII), 0, 0, 1, 1},
22586 {&__pyx_n_s_ASMFactor, __pyx_k_ASMFactor,
sizeof(__pyx_k_ASMFactor), 0, 0, 1, 1},
22587 {&__pyx_n_s_ASMFactor___init, __pyx_k_ASMFactor___init,
sizeof(__pyx_k_ASMFactor___init), 0, 0, 1, 1},
22588 {&__pyx_n_s_BASMFactor, __pyx_k_BASMFactor,
sizeof(__pyx_k_BASMFactor), 0, 0, 1, 1},
22589 {&__pyx_n_s_BASMFactor___init, __pyx_k_BASMFactor___init,
sizeof(__pyx_k_BASMFactor___init), 0, 0, 1, 1},
22590 {&__pyx_kp_s_Buffer_view_does_not_expose_stri, __pyx_k_Buffer_view_does_not_expose_stri,
sizeof(__pyx_k_Buffer_view_does_not_expose_stri), 0, 0, 1, 0},
22591 {&__pyx_kp_s_Can_only_create_a_buffer_that_is, __pyx_k_Can_only_create_a_buffer_that_is,
sizeof(__pyx_k_Can_only_create_a_buffer_that_is), 0, 0, 1, 0},
22592 {&__pyx_kp_s_Cannot_assign_to_read_only_memor, __pyx_k_Cannot_assign_to_read_only_memor,
sizeof(__pyx_k_Cannot_assign_to_read_only_memor), 0, 0, 1, 0},
22593 {&__pyx_kp_s_Cannot_create_writable_memory_vi, __pyx_k_Cannot_create_writable_memory_vi,
sizeof(__pyx_k_Cannot_create_writable_memory_vi), 0, 0, 1, 0},
22594 {&__pyx_kp_s_Cannot_index_with_type_s, __pyx_k_Cannot_index_with_type_s,
sizeof(__pyx_k_Cannot_index_with_type_s), 0, 0, 1, 0},
22595 {&__pyx_n_s_Ellipsis, __pyx_k_Ellipsis,
sizeof(__pyx_k_Ellipsis), 0, 0, 1, 1},
22596 {&__pyx_kp_s_Empty_shape_tuple_for_cython_arr, __pyx_k_Empty_shape_tuple_for_cython_arr,
sizeof(__pyx_k_Empty_shape_tuple_for_cython_arr), 0, 0, 1, 0},
22597 {&__pyx_kp_u_Format_string_allocated_too_shor, __pyx_k_Format_string_allocated_too_shor,
sizeof(__pyx_k_Format_string_allocated_too_shor), 0, 1, 0, 0},
22598 {&__pyx_kp_u_Format_string_allocated_too_shor_2, __pyx_k_Format_string_allocated_too_shor_2,
sizeof(__pyx_k_Format_string_allocated_too_shor_2), 0, 1, 0, 0},
22599 {&__pyx_n_s_ImportError, __pyx_k_ImportError,
sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
22600 {&__pyx_kp_s_Incompatible_checksums_s_vs_0xb0, __pyx_k_Incompatible_checksums_s_vs_0xb0,
sizeof(__pyx_k_Incompatible_checksums_s_vs_0xb0), 0, 0, 1, 0},
22601 {&__pyx_n_s_IndexError, __pyx_k_IndexError,
sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
22602 {&__pyx_kp_s_Indirect_dimensions_not_supporte, __pyx_k_Indirect_dimensions_not_supporte,
sizeof(__pyx_k_Indirect_dimensions_not_supporte), 0, 0, 1, 0},
22603 {&__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_k_Invalid_mode_expected_c_or_fortr,
sizeof(__pyx_k_Invalid_mode_expected_c_or_fortr), 0, 0, 1, 0},
22604 {&__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_k_Invalid_shape_in_axis_d_d,
sizeof(__pyx_k_Invalid_shape_in_axis_d_d), 0, 0, 1, 0},
22605 {&__pyx_n_s_L, __pyx_k_L,
sizeof(__pyx_k_L), 0, 0, 1, 1},
22606 {&__pyx_n_s_M, __pyx_k_M,
sizeof(__pyx_k_M), 0, 0, 1, 1},
22607 {&__pyx_n_s_MemoryError, __pyx_k_MemoryError,
sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
22608 {&__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_k_MemoryView_of_r_at_0x_x,
sizeof(__pyx_k_MemoryView_of_r_at_0x_x), 0, 0, 1, 0},
22609 {&__pyx_kp_s_MemoryView_of_r_object, __pyx_k_MemoryView_of_r_object,
sizeof(__pyx_k_MemoryView_of_r_object), 0, 0, 1, 0},
22610 {&__pyx_kp_u_Non_native_byte_order_not_suppor, __pyx_k_Non_native_byte_order_not_suppor,
sizeof(__pyx_k_Non_native_byte_order_not_suppor), 0, 1, 0, 0},
22611 {&__pyx_n_b_O, __pyx_k_O,
sizeof(__pyx_k_O), 0, 0, 0, 1},
22612 {&__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_k_Out_of_bounds_on_buffer_access_a,
sizeof(__pyx_k_Out_of_bounds_on_buffer_access_a), 0, 0, 1, 0},
22613 {&__pyx_n_s_PickleError, __pyx_k_PickleError,
sizeof(__pyx_k_PickleError), 0, 0, 1, 1},
22614 {&__pyx_n_s_R, __pyx_k_R,
sizeof(__pyx_k_R), 0, 0, 1, 1},
22615 {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError,
sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
22616 {&__pyx_n_s_TypeError, __pyx_k_TypeError,
sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
22617 {&__pyx_kp_s_Unable_to_convert_item_to_object, __pyx_k_Unable_to_convert_item_to_object,
sizeof(__pyx_k_Unable_to_convert_item_to_object), 0, 0, 1, 0},
22618 {&__pyx_n_s_ValueError, __pyx_k_ValueError,
sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
22619 {&__pyx_n_s_View_MemoryView, __pyx_k_View_MemoryView,
sizeof(__pyx_k_View_MemoryView), 0, 0, 1, 1},
22620 {&__pyx_n_s_allocate_buffer, __pyx_k_allocate_buffer,
sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1},
22621 {&__pyx_n_s_asmFactor, __pyx_k_asmFactor,
sizeof(__pyx_k_asmFactor), 0, 0, 1, 1},
22622 {&__pyx_n_s_asm_NR_prepare, __pyx_k_asm_NR_prepare,
sizeof(__pyx_k_asm_NR_prepare), 0, 0, 1, 1},
22623 {&__pyx_n_s_asm_NR_solve, __pyx_k_asm_NR_solve,
sizeof(__pyx_k_asm_NR_solve), 0, 0, 1, 1},
22624 {&__pyx_n_s_base, __pyx_k_base,
sizeof(__pyx_k_base), 0, 0, 1, 1},
22625 {&__pyx_n_s_basmFactor, __pyx_k_basmFactor,
sizeof(__pyx_k_basmFactor), 0, 0, 1, 1},
22626 {&__pyx_n_s_basm_NR_prepare, __pyx_k_basm_NR_prepare,
sizeof(__pyx_k_basm_NR_prepare), 0, 0, 1, 1},
22627 {&__pyx_n_s_basm_NR_solve, __pyx_k_basm_NR_solve,
sizeof(__pyx_k_basm_NR_solve), 0, 0, 1, 1},
22628 {&__pyx_n_s_bs, __pyx_k_bs,
sizeof(__pyx_k_bs), 0, 0, 1, 1},
22629 {&__pyx_n_s_c, __pyx_k_c,
sizeof(__pyx_k_c), 0, 0, 1, 1},
22630 {&__pyx_n_u_c, __pyx_k_c,
sizeof(__pyx_k_c), 0, 1, 0, 1},
22631 {&__pyx_n_s_cASMFactor, __pyx_k_cASMFactor,
sizeof(__pyx_k_cASMFactor), 0, 0, 1, 1},
22632 {&__pyx_n_s_cASMFactor_2, __pyx_k_cASMFactor_2,
sizeof(__pyx_k_cASMFactor_2), 0, 0, 1, 1},
22633 {&__pyx_n_s_cBASMFactor, __pyx_k_cBASMFactor,
sizeof(__pyx_k_cBASMFactor), 0, 0, 1, 1},
22634 {&__pyx_n_s_cBASMFactor_2, __pyx_k_cBASMFactor_2,
sizeof(__pyx_k_cBASMFactor_2), 0, 0, 1, 1},
22635 {&__pyx_n_s_cSparseMatrix, __pyx_k_cSparseMatrix,
sizeof(__pyx_k_cSparseMatrix), 0, 0, 1, 1},
22636 {&__pyx_n_s_class, __pyx_k_class,
sizeof(__pyx_k_class), 0, 0, 1, 1},
22637 {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback,
sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
22638 {&__pyx_kp_s_contiguous_and_direct, __pyx_k_contiguous_and_direct,
sizeof(__pyx_k_contiguous_and_direct), 0, 0, 1, 0},
22639 {&__pyx_kp_s_contiguous_and_indirect, __pyx_k_contiguous_and_indirect,
sizeof(__pyx_k_contiguous_and_indirect), 0, 0, 1, 0},
22640 {&__pyx_n_s_csmoothers, __pyx_k_csmoothers,
sizeof(__pyx_k_csmoothers), 0, 0, 1, 1},
22641 {&__pyx_n_s_dX, __pyx_k_dX,
sizeof(__pyx_k_dX), 0, 0, 1, 1},
22642 {&__pyx_n_s_dict, __pyx_k_dict,
sizeof(__pyx_k_dict), 0, 0, 1, 1},
22643 {&__pyx_n_s_doc, __pyx_k_doc,
sizeof(__pyx_k_doc), 0, 0, 1, 1},
22644 {&__pyx_n_s_dtype_is_object, __pyx_k_dtype_is_object,
sizeof(__pyx_k_dtype_is_object), 0, 0, 1, 1},
22645 {&__pyx_n_s_encode, __pyx_k_encode,
sizeof(__pyx_k_encode), 0, 0, 1, 1},
22646 {&__pyx_n_s_enumerate, __pyx_k_enumerate,
sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
22647 {&__pyx_n_s_error, __pyx_k_error,
sizeof(__pyx_k_error), 0, 0, 1, 1},
22648 {&__pyx_n_s_flags, __pyx_k_flags,
sizeof(__pyx_k_flags), 0, 0, 1, 1},
22649 {&__pyx_n_s_format, __pyx_k_format,
sizeof(__pyx_k_format), 0, 0, 1, 1},
22650 {&__pyx_n_s_fortran, __pyx_k_fortran,
sizeof(__pyx_k_fortran), 0, 0, 1, 1},
22651 {&__pyx_n_u_fortran, __pyx_k_fortran,
sizeof(__pyx_k_fortran), 0, 1, 0, 1},
22652 {&__pyx_n_s_gauss_seidel_NR_preare, __pyx_k_gauss_seidel_NR_preare,
sizeof(__pyx_k_gauss_seidel_NR_preare), 0, 0, 1, 1},
22653 {&__pyx_n_s_gauss_seidel_NR_solve, __pyx_k_gauss_seidel_NR_solve,
sizeof(__pyx_k_gauss_seidel_NR_solve), 0, 0, 1, 1},
22654 {&__pyx_n_s_getstate, __pyx_k_getstate,
sizeof(__pyx_k_getstate), 0, 0, 1, 1},
22655 {&__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_k_got_differing_extents_in_dimensi,
sizeof(__pyx_k_got_differing_extents_in_dimensi), 0, 0, 1, 0},
22656 {&__pyx_n_s_id, __pyx_k_id,
sizeof(__pyx_k_id), 0, 0, 1, 1},
22657 {&__pyx_n_s_import, __pyx_k_import,
sizeof(__pyx_k_import), 0, 0, 1, 1},
22658 {&__pyx_n_s_init, __pyx_k_init,
sizeof(__pyx_k_init), 0, 0, 1, 1},
22659 {&__pyx_n_s_itemsize, __pyx_k_itemsize,
sizeof(__pyx_k_itemsize), 0, 0, 1, 1},
22660 {&__pyx_kp_s_itemsize_0_for_cython_array, __pyx_k_itemsize_0_for_cython_array,
sizeof(__pyx_k_itemsize_0_for_cython_array), 0, 0, 1, 0},
22661 {&__pyx_n_s_jacobi_NR_prepare, __pyx_k_jacobi_NR_prepare,
sizeof(__pyx_k_jacobi_NR_prepare), 0, 0, 1, 1},
22662 {&__pyx_n_s_jacobi_NR_solve, __pyx_k_jacobi_NR_solve,
sizeof(__pyx_k_jacobi_NR_solve), 0, 0, 1, 1},
22663 {&__pyx_n_s_main, __pyx_k_main,
sizeof(__pyx_k_main), 0, 0, 1, 1},
22664 {&__pyx_n_s_memview, __pyx_k_memview,
sizeof(__pyx_k_memview), 0, 0, 1, 1},
22665 {&__pyx_n_s_metaclass, __pyx_k_metaclass,
sizeof(__pyx_k_metaclass), 0, 0, 1, 1},
22666 {&__pyx_n_s_mode, __pyx_k_mode,
sizeof(__pyx_k_mode), 0, 0, 1, 1},
22667 {&__pyx_n_s_module, __pyx_k_module,
sizeof(__pyx_k_module), 0, 0, 1, 1},
22668 {&__pyx_n_s_name, __pyx_k_name,
sizeof(__pyx_k_name), 0, 0, 1, 1},
22669 {&__pyx_n_s_name_2, __pyx_k_name_2,
sizeof(__pyx_k_name_2), 0, 0, 1, 1},
22670 {&__pyx_n_s_nc, __pyx_k_nc,
sizeof(__pyx_k_nc), 0, 0, 1, 1},
22671 {&__pyx_n_s_ndim, __pyx_k_ndim,
sizeof(__pyx_k_ndim), 0, 0, 1, 1},
22672 {&__pyx_n_s_new, __pyx_k_new,
sizeof(__pyx_k_new), 0, 0, 1, 1},
22673 {&__pyx_n_s_nl_gauss_seidel_NR_solve, __pyx_k_nl_gauss_seidel_NR_solve,
sizeof(__pyx_k_nl_gauss_seidel_NR_solve), 0, 0, 1, 1},
22674 {&__pyx_n_s_nl_jacobi_NR_solve, __pyx_k_nl_jacobi_NR_solve,
sizeof(__pyx_k_nl_jacobi_NR_solve), 0, 0, 1, 1},
22675 {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non,
sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0},
22676 {&__pyx_n_s_node_order, __pyx_k_node_order,
sizeof(__pyx_k_node_order), 0, 0, 1, 1},
22677 {&__pyx_n_s_np, __pyx_k_np,
sizeof(__pyx_k_np), 0, 0, 1, 1},
22678 {&__pyx_n_s_nr, __pyx_k_nr,
sizeof(__pyx_k_nr), 0, 0, 1, 1},
22679 {&__pyx_n_s_numpy, __pyx_k_numpy,
sizeof(__pyx_k_numpy), 0, 0, 1, 1},
22680 {&__pyx_kp_s_numpy_core_multiarray_failed_to, __pyx_k_numpy_core_multiarray_failed_to,
sizeof(__pyx_k_numpy_core_multiarray_failed_to), 0, 0, 1, 0},
22681 {&__pyx_kp_s_numpy_core_umath_failed_to_impor, __pyx_k_numpy_core_umath_failed_to_impor,
sizeof(__pyx_k_numpy_core_umath_failed_to_impor), 0, 0, 1, 0},
22682 {&__pyx_n_s_obj, __pyx_k_obj,
sizeof(__pyx_k_obj), 0, 0, 1, 1},
22683 {&__pyx_n_s_object, __pyx_k_object,
sizeof(__pyx_k_object), 0, 0, 1, 1},
22684 {&__pyx_n_s_pack, __pyx_k_pack,
sizeof(__pyx_k_pack), 0, 0, 1, 1},
22685 {&__pyx_n_s_pickle, __pyx_k_pickle,
sizeof(__pyx_k_pickle), 0, 0, 1, 1},
22686 {&__pyx_n_s_prepare, __pyx_k_prepare,
sizeof(__pyx_k_prepare), 0, 0, 1, 1},
22687 {&__pyx_kp_s_proteus_csmoothers_pyx, __pyx_k_proteus_csmoothers_pyx,
sizeof(__pyx_k_proteus_csmoothers_pyx), 0, 0, 1, 0},
22688 {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError,
sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1},
22689 {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum,
sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1},
22690 {&__pyx_n_s_pyx_getbuffer, __pyx_k_pyx_getbuffer,
sizeof(__pyx_k_pyx_getbuffer), 0, 0, 1, 1},
22691 {&__pyx_n_s_pyx_result, __pyx_k_pyx_result,
sizeof(__pyx_k_pyx_result), 0, 0, 1, 1},
22692 {&__pyx_n_s_pyx_state, __pyx_k_pyx_state,
sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},
22693 {&__pyx_n_s_pyx_type, __pyx_k_pyx_type,
sizeof(__pyx_k_pyx_type), 0, 0, 1, 1},
22694 {&__pyx_n_s_pyx_unpickle_Enum, __pyx_k_pyx_unpickle_Enum,
sizeof(__pyx_k_pyx_unpickle_Enum), 0, 0, 1, 1},
22695 {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable,
sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
22696 {&__pyx_n_s_qualname, __pyx_k_qualname,
sizeof(__pyx_k_qualname), 0, 0, 1, 1},
22697 {&__pyx_n_s_range, __pyx_k_range,
sizeof(__pyx_k_range), 0, 0, 1, 1},
22698 {&__pyx_n_s_reduce, __pyx_k_reduce,
sizeof(__pyx_k_reduce), 0, 0, 1, 1},
22699 {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython,
sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
22700 {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex,
sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
22701 {&__pyx_n_s_self, __pyx_k_self,
sizeof(__pyx_k_self), 0, 0, 1, 1},
22702 {&__pyx_n_s_setstate, __pyx_k_setstate,
sizeof(__pyx_k_setstate), 0, 0, 1, 1},
22703 {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython,
sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
22704 {&__pyx_n_s_shape, __pyx_k_shape,
sizeof(__pyx_k_shape), 0, 0, 1, 1},
22705 {&__pyx_n_s_size, __pyx_k_size,
sizeof(__pyx_k_size), 0, 0, 1, 1},
22706 {&__pyx_n_s_start, __pyx_k_start,
sizeof(__pyx_k_start), 0, 0, 1, 1},
22707 {&__pyx_n_s_step, __pyx_k_step,
sizeof(__pyx_k_step), 0, 0, 1, 1},
22708 {&__pyx_n_s_stop, __pyx_k_stop,
sizeof(__pyx_k_stop), 0, 0, 1, 1},
22709 {&__pyx_kp_s_strided_and_direct, __pyx_k_strided_and_direct,
sizeof(__pyx_k_strided_and_direct), 0, 0, 1, 0},
22710 {&__pyx_kp_s_strided_and_direct_or_indirect, __pyx_k_strided_and_direct_or_indirect,
sizeof(__pyx_k_strided_and_direct_or_indirect), 0, 0, 1, 0},
22711 {&__pyx_kp_s_strided_and_indirect, __pyx_k_strided_and_indirect,
sizeof(__pyx_k_strided_and_indirect), 0, 0, 1, 0},
22712 {&__pyx_kp_s_stringsource, __pyx_k_stringsource,
sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
22713 {&__pyx_n_s_struct, __pyx_k_struct,
sizeof(__pyx_k_struct), 0, 0, 1, 1},
22714 {&__pyx_n_s_test, __pyx_k_test,
sizeof(__pyx_k_test), 0, 0, 1, 1},
22715 {&__pyx_n_s_tol, __pyx_k_tol,
sizeof(__pyx_k_tol), 0, 0, 1, 1},
22716 {&__pyx_kp_s_unable_to_allocate_array_data, __pyx_k_unable_to_allocate_array_data,
sizeof(__pyx_k_unable_to_allocate_array_data), 0, 0, 1, 0},
22717 {&__pyx_kp_s_unable_to_allocate_shape_and_str, __pyx_k_unable_to_allocate_shape_and_str,
sizeof(__pyx_k_unable_to_allocate_shape_and_str), 0, 0, 1, 0},
22718 {&__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_k_unknown_dtype_code_in_numpy_pxd,
sizeof(__pyx_k_unknown_dtype_code_in_numpy_pxd), 0, 1, 0, 0},
22719 {&__pyx_n_s_unpack, __pyx_k_unpack,
sizeof(__pyx_k_unpack), 0, 0, 1, 1},
22720 {&__pyx_n_s_update, __pyx_k_update,
sizeof(__pyx_k_update), 0, 0, 1, 1},
22721 {&__pyx_n_s_w, __pyx_k_w,
sizeof(__pyx_k_w), 0, 0, 1, 1},
22722 {0, 0, 0, 0, 0, 0, 0}
22724 static CYTHON_SMALL_CODE
int __Pyx_InitCachedBuiltins(
void) {
22725 __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object);
if (!__pyx_builtin_object) __PYX_ERR(0, 5, __pyx_L1_error)
22726 __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError);
if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error)
22727 __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError);
if (!__pyx_builtin_RuntimeError) __PYX_ERR(2, 777, __pyx_L1_error)
22728 __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError);
if (!__pyx_builtin_ValueError) __PYX_ERR(2, 781, __pyx_L1_error)
22729 __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError);
if (!__pyx_builtin_ImportError) __PYX_ERR(2, 959, __pyx_L1_error)
22730 __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError);
if (!__pyx_builtin_MemoryError) __PYX_ERR(1, 148, __pyx_L1_error)
22731 __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate);
if (!__pyx_builtin_enumerate) __PYX_ERR(1, 151, __pyx_L1_error)
22732 __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range);
if (!__pyx_builtin_range) __PYX_ERR(1, 180, __pyx_L1_error)
22733 __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis);
if (!__pyx_builtin_Ellipsis) __PYX_ERR(1, 404, __pyx_L1_error)
22734 __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id);
if (!__pyx_builtin_id) __PYX_ERR(1, 613, __pyx_L1_error)
22735 __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError);
if (!__pyx_builtin_IndexError) __PYX_ERR(1, 832, __pyx_L1_error)
22741 static CYTHON_SMALL_CODE
int __Pyx_InitCachedConstants(
void) {
22742 __Pyx_RefNannyDeclarations
22743 __Pyx_RefNannySetupContext(
"__Pyx_InitCachedConstants", 0);
22751 __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple_)) __PYX_ERR(1, 2, __pyx_L1_error)
22752 __Pyx_GOTREF(__pyx_tuple_);
22753 __Pyx_GIVEREF(__pyx_tuple_);
22760 __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__2)) __PYX_ERR(1, 4, __pyx_L1_error)
22761 __Pyx_GOTREF(__pyx_tuple__2);
22762 __Pyx_GIVEREF(__pyx_tuple__2);
22770 __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__3)) __PYX_ERR(1, 2, __pyx_L1_error)
22771 __Pyx_GOTREF(__pyx_tuple__3);
22772 __Pyx_GIVEREF(__pyx_tuple__3);
22779 __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__4)) __PYX_ERR(1, 4, __pyx_L1_error)
22780 __Pyx_GOTREF(__pyx_tuple__4);
22781 __Pyx_GIVEREF(__pyx_tuple__4);
22790 __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor);
if (unlikely(!__pyx_tuple__5)) __PYX_ERR(2, 777, __pyx_L1_error)
22791 __Pyx_GOTREF(__pyx_tuple__5);
22792 __Pyx_GIVEREF(__pyx_tuple__5);
22801 __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor);
if (unlikely(!__pyx_tuple__6)) __PYX_ERR(2, 781, __pyx_L1_error)
22802 __Pyx_GOTREF(__pyx_tuple__6);
22803 __Pyx_GIVEREF(__pyx_tuple__6);
22812 __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2);
if (unlikely(!__pyx_tuple__7)) __PYX_ERR(2, 801, __pyx_L1_error)
22813 __Pyx_GOTREF(__pyx_tuple__7);
22814 __Pyx_GIVEREF(__pyx_tuple__7);
22823 __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to);
if (unlikely(!__pyx_tuple__8)) __PYX_ERR(2, 959, __pyx_L1_error)
22824 __Pyx_GOTREF(__pyx_tuple__8);
22825 __Pyx_GIVEREF(__pyx_tuple__8);
22834 __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor);
if (unlikely(!__pyx_tuple__9)) __PYX_ERR(2, 965, __pyx_L1_error)
22835 __Pyx_GOTREF(__pyx_tuple__9);
22836 __Pyx_GIVEREF(__pyx_tuple__9);
22845 __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr);
if (unlikely(!__pyx_tuple__10)) __PYX_ERR(1, 133, __pyx_L1_error)
22846 __Pyx_GOTREF(__pyx_tuple__10);
22847 __Pyx_GIVEREF(__pyx_tuple__10);
22856 __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array);
if (unlikely(!__pyx_tuple__11)) __PYX_ERR(1, 136, __pyx_L1_error)
22857 __Pyx_GOTREF(__pyx_tuple__11);
22858 __Pyx_GIVEREF(__pyx_tuple__11);
22867 __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str);
if (unlikely(!__pyx_tuple__12)) __PYX_ERR(1, 148, __pyx_L1_error)
22868 __Pyx_GOTREF(__pyx_tuple__12);
22869 __Pyx_GIVEREF(__pyx_tuple__12);
22878 __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data);
if (unlikely(!__pyx_tuple__13)) __PYX_ERR(1, 176, __pyx_L1_error)
22879 __Pyx_GOTREF(__pyx_tuple__13);
22880 __Pyx_GIVEREF(__pyx_tuple__13);
22889 __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is);
if (unlikely(!__pyx_tuple__14)) __PYX_ERR(1, 192, __pyx_L1_error)
22890 __Pyx_GOTREF(__pyx_tuple__14);
22891 __Pyx_GIVEREF(__pyx_tuple__14);
22899 __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__15)) __PYX_ERR(1, 2, __pyx_L1_error)
22900 __Pyx_GOTREF(__pyx_tuple__15);
22901 __Pyx_GIVEREF(__pyx_tuple__15);
22908 __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__16)) __PYX_ERR(1, 4, __pyx_L1_error)
22909 __Pyx_GOTREF(__pyx_tuple__16);
22910 __Pyx_GIVEREF(__pyx_tuple__16);
22919 __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_Cannot_assign_to_read_only_memor);
if (unlikely(!__pyx_tuple__17)) __PYX_ERR(1, 418, __pyx_L1_error)
22920 __Pyx_GOTREF(__pyx_tuple__17);
22921 __Pyx_GIVEREF(__pyx_tuple__17);
22930 __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object);
if (unlikely(!__pyx_tuple__18)) __PYX_ERR(1, 495, __pyx_L1_error)
22931 __Pyx_GOTREF(__pyx_tuple__18);
22932 __Pyx_GIVEREF(__pyx_tuple__18);
22941 __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_Cannot_create_writable_memory_vi);
if (unlikely(!__pyx_tuple__19)) __PYX_ERR(1, 520, __pyx_L1_error)
22942 __Pyx_GOTREF(__pyx_tuple__19);
22943 __Pyx_GIVEREF(__pyx_tuple__19);
22952 __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri);
if (unlikely(!__pyx_tuple__20)) __PYX_ERR(1, 570, __pyx_L1_error)
22953 __Pyx_GOTREF(__pyx_tuple__20);
22954 __Pyx_GIVEREF(__pyx_tuple__20);
22963 __pyx_tuple__21 = PyTuple_New(1);
if (unlikely(!__pyx_tuple__21)) __PYX_ERR(1, 577, __pyx_L1_error)
22964 __Pyx_GOTREF(__pyx_tuple__21);
22965 __Pyx_INCREF(__pyx_int_neg_1);
22966 __Pyx_GIVEREF(__pyx_int_neg_1);
22967 PyTuple_SET_ITEM(__pyx_tuple__21, 0, __pyx_int_neg_1);
22968 __Pyx_GIVEREF(__pyx_tuple__21);
22976 __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__22)) __PYX_ERR(1, 2, __pyx_L1_error)
22977 __Pyx_GOTREF(__pyx_tuple__22);
22978 __Pyx_GIVEREF(__pyx_tuple__22);
22985 __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__23)) __PYX_ERR(1, 4, __pyx_L1_error)
22986 __Pyx_GOTREF(__pyx_tuple__23);
22987 __Pyx_GIVEREF(__pyx_tuple__23);
22996 __pyx_slice__24 = PySlice_New(Py_None, Py_None, Py_None);
if (unlikely(!__pyx_slice__24)) __PYX_ERR(1, 682, __pyx_L1_error)
22997 __Pyx_GOTREF(__pyx_slice__24);
22998 __Pyx_GIVEREF(__pyx_slice__24);
23007 __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte);
if (unlikely(!__pyx_tuple__25)) __PYX_ERR(1, 703, __pyx_L1_error)
23008 __Pyx_GOTREF(__pyx_tuple__25);
23009 __Pyx_GIVEREF(__pyx_tuple__25);
23017 __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__26)) __PYX_ERR(1, 2, __pyx_L1_error)
23018 __Pyx_GOTREF(__pyx_tuple__26);
23019 __Pyx_GIVEREF(__pyx_tuple__26);
23026 __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__27)) __PYX_ERR(1, 4, __pyx_L1_error)
23027 __Pyx_GOTREF(__pyx_tuple__27);
23028 __Pyx_GIVEREF(__pyx_tuple__27);
23037 __pyx_tuple__28 = PyTuple_Pack(1, __pyx_builtin_object);
if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 5, __pyx_L1_error)
23038 __Pyx_GOTREF(__pyx_tuple__28);
23039 __Pyx_GIVEREF(__pyx_tuple__28);
23048 __pyx_tuple__29 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_L);
if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 7, __pyx_L1_error)
23049 __Pyx_GOTREF(__pyx_tuple__29);
23050 __Pyx_GIVEREF(__pyx_tuple__29);
23051 __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csmoothers_pyx, __pyx_n_s_init, 7, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(0, 7, __pyx_L1_error)
23060 __pyx_tuple__31 = PyTuple_Pack(1, __pyx_builtin_object);
if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 42, __pyx_L1_error)
23061 __Pyx_GOTREF(__pyx_tuple__31);
23062 __Pyx_GIVEREF(__pyx_tuple__31);
23071 __pyx_tuple__32 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_L, __pyx_n_s_bs);
if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 44, __pyx_L1_error)
23072 __Pyx_GOTREF(__pyx_tuple__32);
23073 __Pyx_GIVEREF(__pyx_tuple__32);
23074 __pyx_codeobj__33 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__32, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csmoothers_pyx, __pyx_n_s_init, 44, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__33)) __PYX_ERR(0, 44, __pyx_L1_error)
23083 __pyx_tuple__34 = PyTuple_Pack(4, __pyx_n_s_A, __pyx_n_s_w, __pyx_n_s_tol, __pyx_n_s_M);
if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 84, __pyx_L1_error)
23084 __Pyx_GOTREF(__pyx_tuple__34);
23085 __Pyx_GIVEREF(__pyx_tuple__34);
23086 __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__34, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csmoothers_pyx, __pyx_n_s_jacobi_NR_prepare, 84, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__35)) __PYX_ERR(0, 84, __pyx_L1_error)
23095 __pyx_tuple__36 = PyTuple_Pack(5, __pyx_n_s_A, __pyx_n_s_M, __pyx_n_s_R, __pyx_n_s_node_order, __pyx_n_s_dX);
if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 109, __pyx_L1_error)
23096 __Pyx_GOTREF(__pyx_tuple__36);
23097 __Pyx_GIVEREF(__pyx_tuple__36);
23098 __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(5, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__36, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csmoothers_pyx, __pyx_n_s_jacobi_NR_solve, 109, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__37)) __PYX_ERR(0, 109, __pyx_L1_error)
23107 __pyx_tuple__38 = PyTuple_Pack(6, __pyx_n_s_A, __pyx_n_s_R, __pyx_n_s_node_order, __pyx_n_s_w, __pyx_n_s_tol, __pyx_n_s_dX);
if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 136, __pyx_L1_error)
23108 __Pyx_GOTREF(__pyx_tuple__38);
23109 __Pyx_GIVEREF(__pyx_tuple__38);
23110 __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(6, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__38, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csmoothers_pyx, __pyx_n_s_nl_jacobi_NR_solve, 136, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__39)) __PYX_ERR(0, 136, __pyx_L1_error)
23119 __pyx_tuple__40 = PyTuple_Pack(4, __pyx_n_s_A, __pyx_n_s_w, __pyx_n_s_tol, __pyx_n_s_M);
if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 165, __pyx_L1_error)
23120 __Pyx_GOTREF(__pyx_tuple__40);
23121 __Pyx_GIVEREF(__pyx_tuple__40);
23122 __pyx_codeobj__41 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csmoothers_pyx, __pyx_n_s_gauss_seidel_NR_preare, 165, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__41)) __PYX_ERR(0, 165, __pyx_L1_error)
23131 __pyx_tuple__42 = PyTuple_Pack(5, __pyx_n_s_A, __pyx_n_s_M, __pyx_n_s_R, __pyx_n_s_node_order, __pyx_n_s_dX);
if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 190, __pyx_L1_error)
23132 __Pyx_GOTREF(__pyx_tuple__42);
23133 __Pyx_GIVEREF(__pyx_tuple__42);
23134 __pyx_codeobj__43 = (PyObject*)__Pyx_PyCode_New(5, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__42, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csmoothers_pyx, __pyx_n_s_gauss_seidel_NR_solve, 190, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__43)) __PYX_ERR(0, 190, __pyx_L1_error)
23143 __pyx_tuple__44 = PyTuple_Pack(6, __pyx_n_s_A, __pyx_n_s_R, __pyx_n_s_node_order, __pyx_n_s_w, __pyx_n_s_tol, __pyx_n_s_dX);
if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 217, __pyx_L1_error)
23144 __Pyx_GOTREF(__pyx_tuple__44);
23145 __Pyx_GIVEREF(__pyx_tuple__44);
23146 __pyx_codeobj__45 = (PyObject*)__Pyx_PyCode_New(6, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__44, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csmoothers_pyx, __pyx_n_s_nl_gauss_seidel_NR_solve, 217, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__45)) __PYX_ERR(0, 217, __pyx_L1_error)
23155 __pyx_tuple__46 = PyTuple_Pack(2, __pyx_n_s_A, __pyx_n_s_asmFactor);
if (unlikely(!__pyx_tuple__46)) __PYX_ERR(0, 251, __pyx_L1_error)
23156 __Pyx_GOTREF(__pyx_tuple__46);
23157 __Pyx_GIVEREF(__pyx_tuple__46);
23158 __pyx_codeobj__47 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__46, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csmoothers_pyx, __pyx_n_s_asm_NR_prepare, 251, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__47)) __PYX_ERR(0, 251, __pyx_L1_error)
23167 __pyx_tuple__48 = PyTuple_Pack(6, __pyx_n_s_A, __pyx_n_s_w, __pyx_n_s_asmFactor, __pyx_n_s_node_order, __pyx_n_s_R, __pyx_n_s_dX);
if (unlikely(!__pyx_tuple__48)) __PYX_ERR(0, 277, __pyx_L1_error)
23168 __Pyx_GOTREF(__pyx_tuple__48);
23169 __Pyx_GIVEREF(__pyx_tuple__48);
23170 __pyx_codeobj__49 = (PyObject*)__Pyx_PyCode_New(6, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__48, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csmoothers_pyx, __pyx_n_s_asm_NR_solve, 277, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__49)) __PYX_ERR(0, 277, __pyx_L1_error)
23179 __pyx_tuple__50 = PyTuple_Pack(2, __pyx_n_s_A, __pyx_n_s_basmFactor);
if (unlikely(!__pyx_tuple__50)) __PYX_ERR(0, 321, __pyx_L1_error)
23180 __Pyx_GOTREF(__pyx_tuple__50);
23181 __Pyx_GIVEREF(__pyx_tuple__50);
23182 __pyx_codeobj__51 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__50, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csmoothers_pyx, __pyx_n_s_basm_NR_prepare, 321, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__51)) __PYX_ERR(0, 321, __pyx_L1_error)
23191 __pyx_tuple__52 = PyTuple_Pack(6, __pyx_n_s_A, __pyx_n_s_w, __pyx_n_s_basmFactor, __pyx_n_s_node_order, __pyx_n_s_R, __pyx_n_s_dX);
if (unlikely(!__pyx_tuple__52)) __PYX_ERR(0, 350, __pyx_L1_error)
23192 __Pyx_GOTREF(__pyx_tuple__52);
23193 __Pyx_GIVEREF(__pyx_tuple__52);
23194 __pyx_codeobj__53 = (PyObject*)__Pyx_PyCode_New(6, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__52, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csmoothers_pyx, __pyx_n_s_basm_NR_solve, 350, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__53)) __PYX_ERR(0, 350, __pyx_L1_error)
23203 __pyx_tuple__54 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect);
if (unlikely(!__pyx_tuple__54)) __PYX_ERR(1, 286, __pyx_L1_error)
23204 __Pyx_GOTREF(__pyx_tuple__54);
23205 __Pyx_GIVEREF(__pyx_tuple__54);
23214 __pyx_tuple__55 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct);
if (unlikely(!__pyx_tuple__55)) __PYX_ERR(1, 287, __pyx_L1_error)
23215 __Pyx_GOTREF(__pyx_tuple__55);
23216 __Pyx_GIVEREF(__pyx_tuple__55);
23225 __pyx_tuple__56 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect);
if (unlikely(!__pyx_tuple__56)) __PYX_ERR(1, 288, __pyx_L1_error)
23226 __Pyx_GOTREF(__pyx_tuple__56);
23227 __Pyx_GIVEREF(__pyx_tuple__56);
23236 __pyx_tuple__57 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct);
if (unlikely(!__pyx_tuple__57)) __PYX_ERR(1, 291, __pyx_L1_error)
23237 __Pyx_GOTREF(__pyx_tuple__57);
23238 __Pyx_GIVEREF(__pyx_tuple__57);
23247 __pyx_tuple__58 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect);
if (unlikely(!__pyx_tuple__58)) __PYX_ERR(1, 292, __pyx_L1_error)
23248 __Pyx_GOTREF(__pyx_tuple__58);
23249 __Pyx_GIVEREF(__pyx_tuple__58);
23256 __pyx_tuple__59 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result);
if (unlikely(!__pyx_tuple__59)) __PYX_ERR(1, 1, __pyx_L1_error)
23257 __Pyx_GOTREF(__pyx_tuple__59);
23258 __Pyx_GIVEREF(__pyx_tuple__59);
23259 __pyx_codeobj__60 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__59, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__60)) __PYX_ERR(1, 1, __pyx_L1_error)
23260 __Pyx_RefNannyFinishContext();
23263 __Pyx_RefNannyFinishContext();
23267 static CYTHON_SMALL_CODE
int __Pyx_InitGlobals(
void) {
23268 if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
23269 __pyx_int_0 = PyInt_FromLong(0);
if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
23270 __pyx_int_1 = PyInt_FromLong(1);
if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
23271 __pyx_int_184977713 = PyInt_FromLong(184977713
L);
if (unlikely(!__pyx_int_184977713)) __PYX_ERR(0, 1, __pyx_L1_error)
23272 __pyx_int_neg_1 = PyInt_FromLong(-1);
if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
23278 static CYTHON_SMALL_CODE
int __Pyx_modinit_global_init_code(
void);
23279 static CYTHON_SMALL_CODE
int __Pyx_modinit_variable_export_code(
void);
23280 static CYTHON_SMALL_CODE
int __Pyx_modinit_function_export_code(
void);
23281 static CYTHON_SMALL_CODE
int __Pyx_modinit_type_init_code(
void);
23282 static CYTHON_SMALL_CODE
int __Pyx_modinit_type_import_code(
void);
23283 static CYTHON_SMALL_CODE
int __Pyx_modinit_variable_import_code(
void);
23284 static CYTHON_SMALL_CODE
int __Pyx_modinit_function_import_code(
void);
23286 static int __Pyx_modinit_global_init_code(
void) {
23287 __Pyx_RefNannyDeclarations
23288 __Pyx_RefNannySetupContext(
"__Pyx_modinit_global_init_code", 0);
23290 generic = Py_None; Py_INCREF(Py_None);
23291 strided = Py_None; Py_INCREF(Py_None);
23292 indirect = Py_None; Py_INCREF(Py_None);
23293 contiguous = Py_None; Py_INCREF(Py_None);
23294 indirect_contiguous = Py_None; Py_INCREF(Py_None);
23295 __Pyx_RefNannyFinishContext();
23299 static int __Pyx_modinit_variable_export_code(
void) {
23300 __Pyx_RefNannyDeclarations
23301 __Pyx_RefNannySetupContext(
"__Pyx_modinit_variable_export_code", 0);
23303 __Pyx_RefNannyFinishContext();
23307 static int __Pyx_modinit_function_export_code(
void) {
23308 __Pyx_RefNannyDeclarations
23309 __Pyx_RefNannySetupContext(
"__Pyx_modinit_function_export_code", 0);
23311 __Pyx_RefNannyFinishContext();
23315 static int __Pyx_modinit_type_init_code(
void) {
23316 __Pyx_RefNannyDeclarations
23317 int __pyx_lineno = 0;
23318 const char *__pyx_filename = NULL;
23319 int __pyx_clineno = 0;
23320 __Pyx_RefNannySetupContext(
"__Pyx_modinit_type_init_code", 0);
23322 if (PyType_Ready(&__pyx_type_10csmoothers_cASMFactor) < 0) __PYX_ERR(0, 11, __pyx_L1_error)
23323 #if PY_VERSION_HEX < 0x030800B1
23324 __pyx_type_10csmoothers_cASMFactor.tp_print = 0;
23326 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_10csmoothers_cASMFactor.tp_dictoffset && __pyx_type_10csmoothers_cASMFactor.tp_getattro == PyObject_GenericGetAttr)) {
23327 __pyx_type_10csmoothers_cASMFactor.tp_getattro = __Pyx_PyObject_GenericGetAttr;
23329 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_cASMFactor_2, (PyObject *)&__pyx_type_10csmoothers_cASMFactor) < 0) __PYX_ERR(0, 11, __pyx_L1_error)
23330 if (__Pyx_setup_reduce((PyObject*)&__pyx_type_10csmoothers_cASMFactor) < 0) __PYX_ERR(0, 11, __pyx_L1_error)
23331 __pyx_ptype_10csmoothers_cASMFactor = &__pyx_type_10csmoothers_cASMFactor;
23332 if (PyType_Ready(&__pyx_type_10csmoothers_cBASMFactor) < 0) __PYX_ERR(0, 50, __pyx_L1_error)
23333 #if PY_VERSION_HEX < 0x030800B1
23334 __pyx_type_10csmoothers_cBASMFactor.tp_print = 0;
23336 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_10csmoothers_cBASMFactor.tp_dictoffset && __pyx_type_10csmoothers_cBASMFactor.tp_getattro == PyObject_GenericGetAttr)) {
23337 __pyx_type_10csmoothers_cBASMFactor.tp_getattro = __Pyx_PyObject_GenericGetAttr;
23339 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_cBASMFactor_2, (PyObject *)&__pyx_type_10csmoothers_cBASMFactor) < 0) __PYX_ERR(0, 50, __pyx_L1_error)
23340 if (__Pyx_setup_reduce((PyObject*)&__pyx_type_10csmoothers_cBASMFactor) < 0) __PYX_ERR(0, 50, __pyx_L1_error)
23341 __pyx_ptype_10csmoothers_cBASMFactor = &__pyx_type_10csmoothers_cBASMFactor;
23342 __pyx_vtabptr_array = &__pyx_vtable_array;
23343 __pyx_vtable_array.get_memview = (PyObject *(*)(
struct __pyx_array_obj *))__pyx_array_get_memview;
23344 if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 105, __pyx_L1_error)
23345 #if PY_VERSION_HEX < 0x030800B1
23346 __pyx_type___pyx_array.tp_print = 0;
23348 if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(1, 105, __pyx_L1_error)
23349 if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 105, __pyx_L1_error)
23350 __pyx_array_type = &__pyx_type___pyx_array;
23351 if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 279, __pyx_L1_error)
23352 #if PY_VERSION_HEX < 0x030800B1
23353 __pyx_type___pyx_MemviewEnum.tp_print = 0;
23355 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_MemviewEnum.tp_dictoffset && __pyx_type___pyx_MemviewEnum.tp_getattro == PyObject_GenericGetAttr)) {
23356 __pyx_type___pyx_MemviewEnum.tp_getattro = __Pyx_PyObject_GenericGetAttr;
23358 if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 279, __pyx_L1_error)
23359 __pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum;
23360 __pyx_vtabptr_memoryview = &__pyx_vtable_memoryview;
23361 __pyx_vtable_memoryview.get_item_pointer = (
char *(*)(
struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer;
23362 __pyx_vtable_memoryview.is_slice = (PyObject *(*)(
struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_is_slice;
23363 __pyx_vtable_memoryview.setitem_slice_assignment = (PyObject *(*)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_slice_assignment;
23364 __pyx_vtable_memoryview.setitem_slice_assign_scalar = (PyObject *(*)(
struct __pyx_memoryview_obj *,
struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_setitem_slice_assign_scalar;
23365 __pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed;
23366 __pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(
struct __pyx_memoryview_obj *,
char *))__pyx_memoryview_convert_item_to_object;
23367 __pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(
struct __pyx_memoryview_obj *,
char *, PyObject *))__pyx_memoryview_assign_item_from_object;
23368 if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 330, __pyx_L1_error)
23369 #if PY_VERSION_HEX < 0x030800B1
23370 __pyx_type___pyx_memoryview.tp_print = 0;
23372 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryview.tp_dictoffset && __pyx_type___pyx_memoryview.tp_getattro == PyObject_GenericGetAttr)) {
23373 __pyx_type___pyx_memoryview.tp_getattro = __Pyx_PyObject_GenericGetAttr;
23375 if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(1, 330, __pyx_L1_error)
23376 if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 330, __pyx_L1_error)
23377 __pyx_memoryview_type = &__pyx_type___pyx_memoryview;
23378 __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice;
23379 __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview;
23380 __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(
struct __pyx_memoryview_obj *,
char *))__pyx_memoryviewslice_convert_item_to_object;
23381 __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(
struct __pyx_memoryview_obj *,
char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object;
23382 __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type;
23383 if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 965, __pyx_L1_error)
23384 #if PY_VERSION_HEX < 0x030800B1
23385 __pyx_type___pyx_memoryviewslice.tp_print = 0;
23387 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryviewslice.tp_dictoffset && __pyx_type___pyx_memoryviewslice.tp_getattro == PyObject_GenericGetAttr)) {
23388 __pyx_type___pyx_memoryviewslice.tp_getattro = __Pyx_PyObject_GenericGetAttr;
23390 if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(1, 965, __pyx_L1_error)
23391 if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 965, __pyx_L1_error)
23392 __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice;
23393 __Pyx_RefNannyFinishContext();
23396 __Pyx_RefNannyFinishContext();
23400 static int __Pyx_modinit_type_import_code(
void) {
23401 __Pyx_RefNannyDeclarations
23402 PyObject *__pyx_t_1 = NULL;
23403 int __pyx_lineno = 0;
23404 const char *__pyx_filename = NULL;
23405 int __pyx_clineno = 0;
23406 __Pyx_RefNannySetupContext(
"__Pyx_modinit_type_import_code", 0);
23408 __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME);
if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9, __pyx_L1_error)
23409 __Pyx_GOTREF(__pyx_t_1);
23410 __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME,
"type",
23411 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
23412 sizeof(PyTypeObject),
23414 sizeof(PyHeapTypeObject),
23416 __Pyx_ImportType_CheckSize_Warn);
23417 if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(3, 9, __pyx_L1_error)
23418 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23419 __pyx_t_1 = PyImport_ImportModule(
"numpy");
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 207, __pyx_L1_error)
23420 __Pyx_GOTREF(__pyx_t_1);
23421 __pyx_ptype_5numpy_dtype = __Pyx_ImportType(__pyx_t_1,
"numpy",
"dtype",
sizeof(PyArray_Descr), __Pyx_ImportType_CheckSize_Ignore);
23422 if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(2, 207, __pyx_L1_error)
23423 __pyx_ptype_5numpy_flatiter = __Pyx_ImportType(__pyx_t_1,
"numpy",
"flatiter",
sizeof(PyArrayIterObject), __Pyx_ImportType_CheckSize_Ignore);
23424 if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(2, 230, __pyx_L1_error)
23425 __pyx_ptype_5numpy_broadcast = __Pyx_ImportType(__pyx_t_1,
"numpy",
"broadcast",
sizeof(PyArrayMultiIterObject), __Pyx_ImportType_CheckSize_Ignore);
23426 if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(2, 234, __pyx_L1_error)
23427 __pyx_ptype_5numpy_ndarray = __Pyx_ImportType(__pyx_t_1,
"numpy",
"ndarray",
sizeof(PyArrayObject), __Pyx_ImportType_CheckSize_Ignore);
23428 if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(2, 246, __pyx_L1_error)
23429 __pyx_ptype_5numpy_ufunc = __Pyx_ImportType(__pyx_t_1,
"numpy",
"ufunc",
sizeof(PyUFuncObject), __Pyx_ImportType_CheckSize_Ignore);
23430 if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(2, 839, __pyx_L1_error)
23431 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23432 __pyx_t_1 = PyImport_ImportModule(
"proteus.superluWrappers");
if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 67, __pyx_L1_error)
23433 __Pyx_GOTREF(__pyx_t_1);
23434 __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix = __Pyx_ImportType(__pyx_t_1,
"proteus.superluWrappers",
"cSparseMatrix",
sizeof(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix), __Pyx_ImportType_CheckSize_Warn);
23435 if (!__pyx_ptype_7proteus_15superluWrappers_cSparseMatrix) __PYX_ERR(4, 67, __pyx_L1_error)
23436 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23437 __Pyx_RefNannyFinishContext();
23440 __Pyx_XDECREF(__pyx_t_1);
23441 __Pyx_RefNannyFinishContext();
23445 static int __Pyx_modinit_variable_import_code(
void) {
23446 __Pyx_RefNannyDeclarations
23447 __Pyx_RefNannySetupContext(
"__Pyx_modinit_variable_import_code", 0);
23449 __Pyx_RefNannyFinishContext();
23453 static int __Pyx_modinit_function_import_code(
void) {
23454 __Pyx_RefNannyDeclarations
23455 __Pyx_RefNannySetupContext(
"__Pyx_modinit_function_import_code", 0);
23457 __Pyx_RefNannyFinishContext();
23462 #ifndef CYTHON_NO_PYINIT_EXPORT
23463 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
23464 #elif PY_MAJOR_VERSION < 3
23466 #define __Pyx_PyMODINIT_FUNC extern "C" void
23468 #define __Pyx_PyMODINIT_FUNC void
23472 #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
23474 #define __Pyx_PyMODINIT_FUNC PyObject *
23479 #if PY_MAJOR_VERSION < 3
23480 __Pyx_PyMODINIT_FUNC initcsmoothers(
void) CYTHON_SMALL_CODE;
23481 __Pyx_PyMODINIT_FUNC initcsmoothers(
void)
23483 __Pyx_PyMODINIT_FUNC PyInit_csmoothers(
void) CYTHON_SMALL_CODE;
23484 __Pyx_PyMODINIT_FUNC PyInit_csmoothers(
void)
23485 #if CYTHON_PEP489_MULTI_PHASE_INIT
23487 return PyModuleDef_Init(&__pyx_moduledef);
23489 static CYTHON_SMALL_CODE
int __Pyx_check_single_interpreter(
void) {
23490 #if PY_VERSION_HEX >= 0x030700A1
23491 static PY_INT64_T main_interpreter_id = -1;
23492 PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
23493 if (main_interpreter_id == -1) {
23494 main_interpreter_id = current_id;
23495 return (unlikely(current_id == -1)) ? -1 : 0;
23496 }
else if (unlikely(main_interpreter_id != current_id))
23498 static PyInterpreterState *main_interpreter = NULL;
23499 PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
23500 if (!main_interpreter) {
23501 main_interpreter = current_interpreter;
23502 }
else if (unlikely(main_interpreter != current_interpreter))
23507 "Interpreter change detected - this module can only be loaded into one interpreter per process.");
23512 static CYTHON_SMALL_CODE
int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict,
const char* from_name,
const char* to_name,
int allow_none) {
23513 PyObject *value = PyObject_GetAttrString(spec, from_name);
23515 if (likely(value)) {
23516 if (allow_none || value != Py_None) {
23517 result = PyDict_SetItemString(moddict, to_name, value);
23520 }
else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
23527 static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
23528 PyObject *module = NULL, *moddict, *modname;
23529 if (__Pyx_check_single_interpreter())
23532 return __Pyx_NewRef(__pyx_m);
23533 modname = PyObject_GetAttrString(spec,
"name");
23534 if (unlikely(!modname))
goto bad;
23535 module = PyModule_NewObject(modname);
23536 Py_DECREF(modname);
23537 if (unlikely(!module))
goto bad;
23538 moddict = PyModule_GetDict(module);
23539 if (unlikely(!moddict))
goto bad;
23540 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"loader",
"__loader__", 1) < 0))
goto bad;
23541 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"origin",
"__file__", 1) < 0))
goto bad;
23542 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"parent",
"__package__", 1) < 0))
goto bad;
23543 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"submodule_search_locations",
"__path__", 0) < 0))
goto bad;
23546 Py_XDECREF(module);
23551 static CYTHON_SMALL_CODE
int __pyx_pymod_exec_csmoothers(PyObject *__pyx_pyinit_module)
23555 PyObject *__pyx_t_1 = NULL;
23556 PyObject *__pyx_t_2 = NULL;
23557 PyObject *__pyx_t_3 = NULL;
23558 static PyThread_type_lock __pyx_t_4[8];
23559 int __pyx_lineno = 0;
23560 const char *__pyx_filename = NULL;
23561 int __pyx_clineno = 0;
23562 __Pyx_RefNannyDeclarations
23563 #if CYTHON_PEP489_MULTI_PHASE_INIT
23565 if (__pyx_m == __pyx_pyinit_module)
return 0;
23566 PyErr_SetString(PyExc_RuntimeError,
"Module 'csmoothers' has already been imported. Re-initialisation is not supported.");
23569 #elif PY_MAJOR_VERSION >= 3
23570 if (__pyx_m)
return __Pyx_NewRef(__pyx_m);
23572 #if CYTHON_REFNANNY
23573 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"refnanny");
23574 if (!__Pyx_RefNanny) {
23576 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"Cython.Runtime.refnanny");
23577 if (!__Pyx_RefNanny)
23578 Py_FatalError(
"failed to import 'refnanny' module");
23581 __Pyx_RefNannySetupContext(
"__Pyx_PyMODINIT_FUNC PyInit_csmoothers(void)", 0);
23582 if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23583 #ifdef __Pxy_PyFrame_Initialize_Offsets
23584 __Pxy_PyFrame_Initialize_Offsets();
23586 __pyx_empty_tuple = PyTuple_New(0);
if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
23587 __pyx_empty_bytes = PyBytes_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
23588 __pyx_empty_unicode = PyUnicode_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
23589 #ifdef __Pyx_CyFunction_USED
23590 if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23592 #ifdef __Pyx_FusedFunction_USED
23593 if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23595 #ifdef __Pyx_Coroutine_USED
23596 if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23598 #ifdef __Pyx_Generator_USED
23599 if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23601 #ifdef __Pyx_AsyncGen_USED
23602 if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23604 #ifdef __Pyx_StopAsyncIteration_USED
23605 if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23609 #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
23611 PyEval_InitThreads();
23615 #if CYTHON_PEP489_MULTI_PHASE_INIT
23616 __pyx_m = __pyx_pyinit_module;
23617 Py_INCREF(__pyx_m);
23619 #if PY_MAJOR_VERSION < 3
23620 __pyx_m = Py_InitModule4(
"csmoothers", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
23622 __pyx_m = PyModule_Create(&__pyx_moduledef);
23624 if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
23626 __pyx_d = PyModule_GetDict(__pyx_m);
if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
23627 Py_INCREF(__pyx_d);
23628 __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME);
if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
23629 Py_INCREF(__pyx_b);
23630 __pyx_cython_runtime = PyImport_AddModule((
char *)
"cython_runtime");
if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
23631 Py_INCREF(__pyx_cython_runtime);
23632 if (PyObject_SetAttrString(__pyx_m,
"__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
23634 if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23635 #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
23636 if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23638 if (__pyx_module_is_main_csmoothers) {
23639 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23641 #if PY_MAJOR_VERSION >= 3
23643 PyObject *modules = PyImport_GetModuleDict();
if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
23644 if (!PyDict_GetItemString(modules,
"csmoothers")) {
23645 if (unlikely(PyDict_SetItemString(modules,
"csmoothers", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
23650 if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23652 if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23654 (void)__Pyx_modinit_global_init_code();
23655 (void)__Pyx_modinit_variable_export_code();
23656 (void)__Pyx_modinit_function_export_code();
23657 if (unlikely(__Pyx_modinit_type_init_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
23658 if (unlikely(__Pyx_modinit_type_import_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
23659 (void)__Pyx_modinit_variable_import_code();
23660 (void)__Pyx_modinit_function_import_code();
23662 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
23663 if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23671 __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
23672 __Pyx_GOTREF(__pyx_t_1);
23673 if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23674 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23683 __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__28);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5, __pyx_L1_error)
23684 __Pyx_GOTREF(__pyx_t_1);
23685 __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_tuple__28, __pyx_n_s_ASMFactor, __pyx_n_s_ASMFactor, (PyObject *) NULL, __pyx_n_s_csmoothers, (PyObject *) NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error)
23686 __Pyx_GOTREF(__pyx_t_2);
23695 __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10csmoothers_9ASMFactor_1__init__, 0, __pyx_n_s_ASMFactor___init, NULL, __pyx_n_s_csmoothers, __pyx_d, ((PyObject *)__pyx_codeobj__30));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7, __pyx_L1_error)
23696 __Pyx_GOTREF(__pyx_t_3);
23697 if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_init, __pyx_t_3) < 0) __PYX_ERR(0, 7, __pyx_L1_error)
23698 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23707 __pyx_t_3 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_ASMFactor, __pyx_tuple__28, __pyx_t_2, NULL, 0, 1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5, __pyx_L1_error)
23708 __Pyx_GOTREF(__pyx_t_3);
23709 if (PyDict_SetItem(__pyx_d, __pyx_n_s_ASMFactor, __pyx_t_3) < 0) __PYX_ERR(0, 5, __pyx_L1_error)
23710 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23711 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23712 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23721 __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__31);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 42, __pyx_L1_error)
23722 __Pyx_GOTREF(__pyx_t_1);
23723 __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_tuple__31, __pyx_n_s_BASMFactor, __pyx_n_s_BASMFactor, (PyObject *) NULL, __pyx_n_s_csmoothers, (PyObject *) NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 42, __pyx_L1_error)
23724 __Pyx_GOTREF(__pyx_t_2);
23733 __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10csmoothers_10BASMFactor_1__init__, 0, __pyx_n_s_BASMFactor___init, NULL, __pyx_n_s_csmoothers, __pyx_d, ((PyObject *)__pyx_codeobj__33));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 44, __pyx_L1_error)
23734 __Pyx_GOTREF(__pyx_t_3);
23735 if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_init, __pyx_t_3) < 0) __PYX_ERR(0, 44, __pyx_L1_error)
23736 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23745 __pyx_t_3 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_BASMFactor, __pyx_tuple__31, __pyx_t_2, NULL, 0, 1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 42, __pyx_L1_error)
23746 __Pyx_GOTREF(__pyx_t_3);
23747 if (PyDict_SetItem(__pyx_d, __pyx_n_s_BASMFactor, __pyx_t_3) < 0) __PYX_ERR(0, 42, __pyx_L1_error)
23748 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23749 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23750 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23759 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10csmoothers_1jacobi_NR_prepare, NULL, __pyx_n_s_csmoothers);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 84, __pyx_L1_error)
23760 __Pyx_GOTREF(__pyx_t_1);
23761 if (PyDict_SetItem(__pyx_d, __pyx_n_s_jacobi_NR_prepare, __pyx_t_1) < 0) __PYX_ERR(0, 84, __pyx_L1_error)
23762 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23771 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10csmoothers_3jacobi_NR_solve, NULL, __pyx_n_s_csmoothers);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 109, __pyx_L1_error)
23772 __Pyx_GOTREF(__pyx_t_1);
23773 if (PyDict_SetItem(__pyx_d, __pyx_n_s_jacobi_NR_solve, __pyx_t_1) < 0) __PYX_ERR(0, 109, __pyx_L1_error)
23774 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23783 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10csmoothers_5nl_jacobi_NR_solve, NULL, __pyx_n_s_csmoothers);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 136, __pyx_L1_error)
23784 __Pyx_GOTREF(__pyx_t_1);
23785 if (PyDict_SetItem(__pyx_d, __pyx_n_s_nl_jacobi_NR_solve, __pyx_t_1) < 0) __PYX_ERR(0, 136, __pyx_L1_error)
23786 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23795 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10csmoothers_7gauss_seidel_NR_preare, NULL, __pyx_n_s_csmoothers);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 165, __pyx_L1_error)
23796 __Pyx_GOTREF(__pyx_t_1);
23797 if (PyDict_SetItem(__pyx_d, __pyx_n_s_gauss_seidel_NR_preare, __pyx_t_1) < 0) __PYX_ERR(0, 165, __pyx_L1_error)
23798 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23807 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10csmoothers_9gauss_seidel_NR_solve, NULL, __pyx_n_s_csmoothers);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 190, __pyx_L1_error)
23808 __Pyx_GOTREF(__pyx_t_1);
23809 if (PyDict_SetItem(__pyx_d, __pyx_n_s_gauss_seidel_NR_solve, __pyx_t_1) < 0) __PYX_ERR(0, 190, __pyx_L1_error)
23810 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23819 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10csmoothers_11nl_gauss_seidel_NR_solve, NULL, __pyx_n_s_csmoothers);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 217, __pyx_L1_error)
23820 __Pyx_GOTREF(__pyx_t_1);
23821 if (PyDict_SetItem(__pyx_d, __pyx_n_s_nl_gauss_seidel_NR_solve, __pyx_t_1) < 0) __PYX_ERR(0, 217, __pyx_L1_error)
23822 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23831 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10csmoothers_13asm_NR_prepare, NULL, __pyx_n_s_csmoothers);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 251, __pyx_L1_error)
23832 __Pyx_GOTREF(__pyx_t_1);
23833 if (PyDict_SetItem(__pyx_d, __pyx_n_s_asm_NR_prepare, __pyx_t_1) < 0) __PYX_ERR(0, 251, __pyx_L1_error)
23834 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23843 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10csmoothers_15asm_NR_solve, NULL, __pyx_n_s_csmoothers);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 277, __pyx_L1_error)
23844 __Pyx_GOTREF(__pyx_t_1);
23845 if (PyDict_SetItem(__pyx_d, __pyx_n_s_asm_NR_solve, __pyx_t_1) < 0) __PYX_ERR(0, 277, __pyx_L1_error)
23846 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23855 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10csmoothers_17basm_NR_prepare, NULL, __pyx_n_s_csmoothers);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 321, __pyx_L1_error)
23856 __Pyx_GOTREF(__pyx_t_1);
23857 if (PyDict_SetItem(__pyx_d, __pyx_n_s_basm_NR_prepare, __pyx_t_1) < 0) __PYX_ERR(0, 321, __pyx_L1_error)
23858 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23867 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10csmoothers_19basm_NR_solve, NULL, __pyx_n_s_csmoothers);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 350, __pyx_L1_error)
23868 __Pyx_GOTREF(__pyx_t_1);
23869 if (PyDict_SetItem(__pyx_d, __pyx_n_s_basm_NR_solve, __pyx_t_1) < 0) __PYX_ERR(0, 350, __pyx_L1_error)
23870 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23877 __pyx_t_1 = __Pyx_PyDict_NewPresized(0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
23878 __Pyx_GOTREF(__pyx_t_1);
23879 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23880 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23889 __pyx_t_1 = __pyx_capsule_create(((
void *)(&__pyx_array_getbuffer)), ((
char *)
"getbuffer(obj, view, flags)"));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 209, __pyx_L1_error)
23890 __Pyx_GOTREF(__pyx_t_1);
23891 if (PyDict_SetItem((PyObject *)__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 209, __pyx_L1_error)
23892 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23893 PyType_Modified(__pyx_array_type);
23902 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__54, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 286, __pyx_L1_error)
23903 __Pyx_GOTREF(__pyx_t_1);
23904 __Pyx_XGOTREF(
generic);
23905 __Pyx_DECREF_SET(
generic, __pyx_t_1);
23906 __Pyx_GIVEREF(__pyx_t_1);
23916 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__55, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 287, __pyx_L1_error)
23917 __Pyx_GOTREF(__pyx_t_1);
23918 __Pyx_XGOTREF(strided);
23919 __Pyx_DECREF_SET(strided, __pyx_t_1);
23920 __Pyx_GIVEREF(__pyx_t_1);
23930 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__56, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 288, __pyx_L1_error)
23931 __Pyx_GOTREF(__pyx_t_1);
23932 __Pyx_XGOTREF(indirect);
23933 __Pyx_DECREF_SET(indirect, __pyx_t_1);
23934 __Pyx_GIVEREF(__pyx_t_1);
23944 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__57, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 291, __pyx_L1_error)
23945 __Pyx_GOTREF(__pyx_t_1);
23946 __Pyx_XGOTREF(contiguous);
23947 __Pyx_DECREF_SET(contiguous, __pyx_t_1);
23948 __Pyx_GIVEREF(__pyx_t_1);
23958 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__58, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 292, __pyx_L1_error)
23959 __Pyx_GOTREF(__pyx_t_1);
23960 __Pyx_XGOTREF(indirect_contiguous);
23961 __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_1);
23962 __Pyx_GIVEREF(__pyx_t_1);
23972 __pyx_memoryview_thread_locks_used = 0;
23981 __pyx_t_4[0] = PyThread_allocate_lock();
23982 __pyx_t_4[1] = PyThread_allocate_lock();
23983 __pyx_t_4[2] = PyThread_allocate_lock();
23984 __pyx_t_4[3] = PyThread_allocate_lock();
23985 __pyx_t_4[4] = PyThread_allocate_lock();
23986 __pyx_t_4[5] = PyThread_allocate_lock();
23987 __pyx_t_4[6] = PyThread_allocate_lock();
23988 __pyx_t_4[7] = PyThread_allocate_lock();
23989 memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_4,
sizeof(__pyx_memoryview_thread_locks[0]) * (8));
23998 __pyx_t_1 = __pyx_capsule_create(((
void *)(&__pyx_memoryview_getbuffer)), ((
char *)
"getbuffer(obj, view, flags)"));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 549, __pyx_L1_error)
23999 __Pyx_GOTREF(__pyx_t_1);
24000 if (PyDict_SetItem((PyObject *)__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 549, __pyx_L1_error)
24001 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24002 PyType_Modified(__pyx_memoryview_type);
24011 __pyx_t_1 = __pyx_capsule_create(((
void *)(&__pyx_memoryview_getbuffer)), ((
char *)
"getbuffer(obj, view, flags)"));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 995, __pyx_L1_error)
24012 __Pyx_GOTREF(__pyx_t_1);
24013 if (PyDict_SetItem((PyObject *)__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 995, __pyx_L1_error)
24014 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24015 PyType_Modified(__pyx_memoryviewslice_type);
24022 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum, NULL, __pyx_n_s_View_MemoryView);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
24023 __Pyx_GOTREF(__pyx_t_1);
24024 if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Enum, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
24025 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24039 __Pyx_XDECREF(__pyx_t_1);
24040 __Pyx_XDECREF(__pyx_t_2);
24041 __Pyx_XDECREF(__pyx_t_3);
24044 __Pyx_AddTraceback(
"init csmoothers", __pyx_clineno, __pyx_lineno, __pyx_filename);
24047 }
else if (!PyErr_Occurred()) {
24048 PyErr_SetString(PyExc_ImportError,
"init csmoothers");
24051 __Pyx_RefNannyFinishContext();
24052 #if CYTHON_PEP489_MULTI_PHASE_INIT
24053 return (__pyx_m != NULL) ? 0 : -1;
24054 #elif PY_MAJOR_VERSION >= 3
24063 #if CYTHON_REFNANNY
24064 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname) {
24065 PyObject *m = NULL, *p = NULL;
24067 m = PyImport_ImportModule(modname);
24069 p = PyObject_GetAttrString(m,
"RefNannyAPI");
24071 r = PyLong_AsVoidPtr(p);
24075 return (__Pyx_RefNannyAPIStruct *)
r;
24080 #if CYTHON_USE_TYPE_SLOTS
24081 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
24082 PyTypeObject* tp = Py_TYPE(obj);
24083 if (likely(tp->tp_getattro))
24084 return tp->tp_getattro(obj, attr_name);
24085 #if PY_MAJOR_VERSION < 3
24086 if (likely(tp->tp_getattr))
24087 return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
24089 return PyObject_GetAttr(obj, attr_name);
24094 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
24095 PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
24096 if (unlikely(!result)) {
24097 PyErr_Format(PyExc_NameError,
24098 #
if PY_MAJOR_VERSION >= 3
24099 "name '%U' is not defined", name);
24101 "name '%.200s' is not defined", PyString_AS_STRING(name));
24108 static void __Pyx_RaiseArgtupleInvalid(
24109 const char* func_name,
24111 Py_ssize_t num_min,
24112 Py_ssize_t num_max,
24113 Py_ssize_t num_found)
24115 Py_ssize_t num_expected;
24116 const char *more_or_less;
24117 if (num_found < num_min) {
24118 num_expected = num_min;
24119 more_or_less =
"at least";
24121 num_expected = num_max;
24122 more_or_less =
"at most";
24125 more_or_less =
"exactly";
24127 PyErr_Format(PyExc_TypeError,
24128 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T
"d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T
"d given)",
24129 func_name, more_or_less, num_expected,
24130 (num_expected == 1) ?
"" :
"s", num_found);
24134 static void __Pyx_RaiseDoubleKeywordsError(
24135 const char* func_name,
24138 PyErr_Format(PyExc_TypeError,
24139 #
if PY_MAJOR_VERSION >= 3
24140 "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
24142 "%s() got multiple values for keyword argument '%s'", func_name,
24143 PyString_AsString(kw_name));
24148 static int __Pyx_ParseOptionalKeywords(
24150 PyObject **argnames[],
24152 PyObject *values[],
24153 Py_ssize_t num_pos_args,
24154 const char* function_name)
24156 PyObject *key = 0, *value = 0;
24157 Py_ssize_t
pos = 0;
24159 PyObject*** first_kw_arg = argnames + num_pos_args;
24160 while (PyDict_Next(kwds, &
pos, &key, &value)) {
24161 name = first_kw_arg;
24162 while (*name && (**name != key)) name++;
24164 values[name-argnames] = value;
24167 name = first_kw_arg;
24168 #if PY_MAJOR_VERSION < 3
24169 if (likely(PyString_Check(key))) {
24171 if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
24172 && _PyString_Eq(**name, key)) {
24173 values[name-argnames] = value;
24178 if (*name)
continue;
24180 PyObject*** argname = argnames;
24181 while (argname != first_kw_arg) {
24182 if ((**argname == key) || (
24183 (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
24184 && _PyString_Eq(**argname, key))) {
24185 goto arg_passed_twice;
24192 if (likely(PyUnicode_Check(key))) {
24194 int cmp = (**name == key) ? 0 :
24195 #
if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
24196 (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
24198 PyUnicode_Compare(**name, key);
24199 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
24201 values[name-argnames] = value;
24206 if (*name)
continue;
24208 PyObject*** argname = argnames;
24209 while (argname != first_kw_arg) {
24210 int cmp = (**argname == key) ? 0 :
24211 #
if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
24212 (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
24214 PyUnicode_Compare(**argname, key);
24215 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
24216 if (cmp == 0)
goto arg_passed_twice;
24221 goto invalid_keyword_type;
24223 if (unlikely(PyDict_SetItem(kwds2, key, value)))
goto bad;
24225 goto invalid_keyword;
24230 __Pyx_RaiseDoubleKeywordsError(function_name, key);
24232 invalid_keyword_type:
24233 PyErr_Format(PyExc_TypeError,
24234 "%.200s() keywords must be strings", function_name);
24237 PyErr_Format(PyExc_TypeError,
24238 #
if PY_MAJOR_VERSION < 3
24239 "%.200s() got an unexpected keyword argument '%.200s'",
24240 function_name, PyString_AsString(key));
24242 "%s() got an unexpected keyword argument '%U'",
24243 function_name, key);
24250 #if CYTHON_USE_TYPE_SLOTS
24251 static CYTHON_INLINE
int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) {
24252 PyTypeObject* tp = Py_TYPE(obj);
24253 if (likely(tp->tp_setattro))
24254 return tp->tp_setattro(obj, attr_name, value);
24255 #if PY_MAJOR_VERSION < 3
24256 if (likely(tp->tp_setattr))
24257 return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value);
24259 return PyObject_SetAttr(obj, attr_name, value);
24264 #if CYTHON_FAST_PYCCALL
24265 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
24266 PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
24267 PyCFunction meth = PyCFunction_GET_FUNCTION(func);
24268 PyObject *
self = PyCFunction_GET_SELF(func);
24269 int flags = PyCFunction_GET_FLAGS(func);
24270 assert(PyCFunction_Check(func));
24271 assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
24272 assert(nargs >= 0);
24273 assert(nargs == 0 || args != NULL);
24277 assert(!PyErr_Occurred());
24278 if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
24279 return (*((__Pyx_PyCFunctionFastWithKeywords)(
void*)meth)) (
self, args, nargs, NULL);
24281 return (*((__Pyx_PyCFunctionFast)(
void*)meth)) (
self, args, nargs);
24287 #if CYTHON_FAST_PYCALL
24288 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
24289 PyObject *globals) {
24291 PyThreadState *tstate = __Pyx_PyThreadState_Current;
24292 PyObject **fastlocals;
24295 assert(globals != NULL);
24300 assert(tstate != NULL);
24301 f = PyFrame_New(tstate, co, globals, NULL);
24305 fastlocals = __Pyx_PyFrame_GetLocalsplus(
f);
24306 for (i = 0; i < na; i++) {
24308 fastlocals[i] = *args++;
24310 result = PyEval_EvalFrameEx(
f,0);
24311 ++tstate->recursion_depth;
24313 --tstate->recursion_depth;
24316 #if 1 || PY_VERSION_HEX < 0x030600B1
24317 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
24318 PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
24319 PyObject *globals = PyFunction_GET_GLOBALS(func);
24320 PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
24322 #if PY_MAJOR_VERSION >= 3
24325 PyObject *kwtuple, **k;
24330 assert(kwargs == NULL || PyDict_Check(kwargs));
24331 nk = kwargs ? PyDict_Size(kwargs) : 0;
24332 if (Py_EnterRecursiveCall((
char*)
" while calling a Python object")) {
24336 #
if PY_MAJOR_VERSION >= 3
24337 co->co_kwonlyargcount == 0 &&
24339 likely(kwargs == NULL || nk == 0) &&
24340 co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
24341 if (argdefs == NULL && co->co_argcount == nargs) {
24342 result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
24345 else if (nargs == 0 && argdefs != NULL
24346 && co->co_argcount == Py_SIZE(argdefs)) {
24349 args = &PyTuple_GET_ITEM(argdefs, 0);
24350 result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
24354 if (kwargs != NULL) {
24356 kwtuple = PyTuple_New(2 * nk);
24357 if (kwtuple == NULL) {
24361 k = &PyTuple_GET_ITEM(kwtuple, 0);
24363 while (PyDict_Next(kwargs, &
pos, &k[i], &k[i+1])) {
24374 closure = PyFunction_GET_CLOSURE(func);
24375 #if PY_MAJOR_VERSION >= 3
24376 kwdefs = PyFunction_GET_KW_DEFAULTS(func);
24378 if (argdefs != NULL) {
24379 d = &PyTuple_GET_ITEM(argdefs, 0);
24380 nd = Py_SIZE(argdefs);
24386 #if PY_MAJOR_VERSION >= 3
24387 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
24390 d, (
int)nd, kwdefs, closure);
24392 result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
24395 d, (
int)nd, closure);
24397 Py_XDECREF(kwtuple);
24399 Py_LeaveRecursiveCall();
24406 #if CYTHON_COMPILING_IN_CPYTHON
24407 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
24409 ternaryfunc call = func->ob_type->tp_call;
24410 if (unlikely(!call))
24411 return PyObject_Call(func, arg, kw);
24412 if (unlikely(Py_EnterRecursiveCall((
char*)
" while calling a Python object")))
24414 result = (*call)(func, arg, kw);
24415 Py_LeaveRecursiveCall();
24416 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
24419 "NULL result without error in PyObject_Call");
24426 #if CYTHON_COMPILING_IN_CPYTHON
24427 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
24428 PyObject *
self, *result;
24430 cfunc = PyCFunction_GET_FUNCTION(func);
24431 self = PyCFunction_GET_SELF(func);
24432 if (unlikely(Py_EnterRecursiveCall((
char*)
" while calling a Python object")))
24434 result = cfunc(
self, arg);
24435 Py_LeaveRecursiveCall();
24436 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
24439 "NULL result without error in PyObject_Call");
24446 #if CYTHON_COMPILING_IN_CPYTHON
24447 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
24449 PyObject *args = PyTuple_New(1);
24450 if (unlikely(!args))
return NULL;
24452 PyTuple_SET_ITEM(args, 0, arg);
24453 result = __Pyx_PyObject_Call(func, args, NULL);
24457 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
24458 #if CYTHON_FAST_PYCALL
24459 if (PyFunction_Check(func)) {
24460 return __Pyx_PyFunction_FastCall(func, &arg, 1);
24463 if (likely(PyCFunction_Check(func))) {
24464 if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
24465 return __Pyx_PyObject_CallMethO(func, arg);
24466 #if CYTHON_FAST_PYCCALL
24467 }
else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) {
24468 return __Pyx_PyCFunction_FastCall(func, &arg, 1);
24472 return __Pyx__PyObject_CallOneArg(func, arg);
24475 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
24477 PyObject *args = PyTuple_Pack(1, arg);
24478 if (unlikely(!args))
return NULL;
24479 result = __Pyx_PyObject_Call(func, args, NULL);
24486 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type,
const char *name,
int exact)
24488 if (unlikely(!type)) {
24489 PyErr_SetString(PyExc_SystemError,
"Missing type object");
24493 #if PY_MAJOR_VERSION == 2
24494 if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj)))
return 1;
24498 if (likely(__Pyx_TypeCheck(obj, type)))
return 1;
24500 PyErr_Format(PyExc_TypeError,
24501 "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
24502 name, type->tp_name, Py_TYPE(obj)->tp_name);
24507 #if CYTHON_FAST_THREAD_STATE
24508 static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
24509 PyObject *tmp_type, *tmp_value, *tmp_tb;
24510 tmp_type = tstate->curexc_type;
24511 tmp_value = tstate->curexc_value;
24512 tmp_tb = tstate->curexc_traceback;
24513 tstate->curexc_type = type;
24514 tstate->curexc_value = value;
24515 tstate->curexc_traceback = tb;
24516 Py_XDECREF(tmp_type);
24517 Py_XDECREF(tmp_value);
24518 Py_XDECREF(tmp_tb);
24520 static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
24521 *type = tstate->curexc_type;
24522 *value = tstate->curexc_value;
24523 *tb = tstate->curexc_traceback;
24524 tstate->curexc_type = 0;
24525 tstate->curexc_value = 0;
24526 tstate->curexc_traceback = 0;
24531 #if PY_MAJOR_VERSION < 3
24532 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
24533 CYTHON_UNUSED PyObject *cause) {
24534 __Pyx_PyThreadState_declare
24536 if (!value || value == Py_None)
24540 if (!tb || tb == Py_None)
24544 if (!PyTraceBack_Check(tb)) {
24545 PyErr_SetString(PyExc_TypeError,
24546 "raise: arg 3 must be a traceback or None");
24550 if (PyType_Check(type)) {
24551 #if CYTHON_COMPILING_IN_PYPY
24553 Py_INCREF(Py_None);
24557 PyErr_NormalizeException(&type, &value, &tb);
24560 PyErr_SetString(PyExc_TypeError,
24561 "instance exception may not have a separate value");
24565 type = (PyObject*) Py_TYPE(type);
24567 if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
24568 PyErr_SetString(PyExc_TypeError,
24569 "raise: exception class must be a subclass of BaseException");
24573 __Pyx_PyThreadState_assign
24574 __Pyx_ErrRestore(type, value, tb);
24583 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
24584 PyObject* owned_instance = NULL;
24585 if (tb == Py_None) {
24587 }
else if (tb && !PyTraceBack_Check(tb)) {
24588 PyErr_SetString(PyExc_TypeError,
24589 "raise: arg 3 must be a traceback or None");
24592 if (value == Py_None)
24594 if (PyExceptionInstance_Check(type)) {
24596 PyErr_SetString(PyExc_TypeError,
24597 "instance exception may not have a separate value");
24601 type = (PyObject*) Py_TYPE(value);
24602 }
else if (PyExceptionClass_Check(type)) {
24603 PyObject *instance_class = NULL;
24604 if (value && PyExceptionInstance_Check(value)) {
24605 instance_class = (PyObject*) Py_TYPE(value);
24606 if (instance_class != type) {
24607 int is_subclass = PyObject_IsSubclass(instance_class, type);
24608 if (!is_subclass) {
24609 instance_class = NULL;
24610 }
else if (unlikely(is_subclass == -1)) {
24613 type = instance_class;
24617 if (!instance_class) {
24620 args = PyTuple_New(0);
24621 else if (PyTuple_Check(value)) {
24625 args = PyTuple_Pack(1, value);
24628 owned_instance = PyObject_Call(type, args, NULL);
24630 if (!owned_instance)
24632 value = owned_instance;
24633 if (!PyExceptionInstance_Check(value)) {
24634 PyErr_Format(PyExc_TypeError,
24635 "calling %R should have returned an instance of "
24636 "BaseException, not %R",
24637 type, Py_TYPE(value));
24642 PyErr_SetString(PyExc_TypeError,
24643 "raise: exception class must be a subclass of BaseException");
24647 PyObject *fixed_cause;
24648 if (cause == Py_None) {
24649 fixed_cause = NULL;
24650 }
else if (PyExceptionClass_Check(cause)) {
24651 fixed_cause = PyObject_CallObject(cause, NULL);
24652 if (fixed_cause == NULL)
24654 }
else if (PyExceptionInstance_Check(cause)) {
24655 fixed_cause = cause;
24656 Py_INCREF(fixed_cause);
24658 PyErr_SetString(PyExc_TypeError,
24659 "exception causes must derive from "
24663 PyException_SetCause(value, fixed_cause);
24665 PyErr_SetObject(type, value);
24667 #if CYTHON_COMPILING_IN_PYPY
24668 PyObject *tmp_type, *tmp_value, *tmp_tb;
24669 PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
24671 PyErr_Restore(tmp_type, tmp_value, tb);
24672 Py_XDECREF(tmp_tb);
24674 PyThreadState *tstate = __Pyx_PyThreadState_Current;
24675 PyObject* tmp_tb = tstate->curexc_traceback;
24676 if (tb != tmp_tb) {
24678 tstate->curexc_traceback = tb;
24679 Py_XDECREF(tmp_tb);
24684 Py_XDECREF(owned_instance);
24690 static CYTHON_INLINE
int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
24691 if (unlikely(!type)) {
24692 PyErr_SetString(PyExc_SystemError,
"Missing type object");
24695 if (likely(__Pyx_TypeCheck(obj, type)))
24697 PyErr_Format(PyExc_TypeError,
"Cannot convert %.200s to %.200s",
24698 Py_TYPE(obj)->tp_name, type->tp_name);
24704 __Pyx_init_memviewslice(
struct __pyx_memoryview_obj *memview,
24706 __Pyx_memviewslice *memviewslice,
24707 int memview_is_new_reference)
24709 __Pyx_RefNannyDeclarations
24711 Py_buffer *buf = &memview->view;
24712 __Pyx_RefNannySetupContext(
"init_memviewslice", 0);
24713 if (unlikely(memviewslice->memview || memviewslice->data)) {
24714 PyErr_SetString(PyExc_ValueError,
24715 "memviewslice is already initialized!");
24718 if (buf->strides) {
24719 for (i = 0; i < ndim; i++) {
24720 memviewslice->strides[i] = buf->strides[i];
24723 Py_ssize_t stride = buf->itemsize;
24724 for (i = ndim - 1; i >= 0; i--) {
24725 memviewslice->strides[i] = stride;
24726 stride *= buf->shape[i];
24729 for (i = 0; i < ndim; i++) {
24730 memviewslice->shape[i] = buf->shape[i];
24731 if (buf->suboffsets) {
24732 memviewslice->suboffsets[i] = buf->suboffsets[i];
24734 memviewslice->suboffsets[i] = -1;
24737 memviewslice->memview = memview;
24738 memviewslice->data = (
char *)buf->buf;
24739 if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) {
24740 Py_INCREF(memview);
24745 memviewslice->memview = 0;
24746 memviewslice->data = 0;
24749 __Pyx_RefNannyFinishContext();
24752 #ifndef Py_NO_RETURN
24753 #define Py_NO_RETURN
24755 static void __pyx_fatalerror(
const char *fmt, ...) Py_NO_RETURN {
24758 #ifdef HAVE_STDARG_PROTOTYPES
24759 va_start(vargs, fmt);
24763 vsnprintf(msg, 200, fmt, vargs);
24765 Py_FatalError(msg);
24767 static CYTHON_INLINE
int
24768 __pyx_add_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
24769 PyThread_type_lock lock)
24772 PyThread_acquire_lock(lock, 1);
24773 result = (*acquisition_count)++;
24774 PyThread_release_lock(lock);
24777 static CYTHON_INLINE
int
24778 __pyx_sub_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
24779 PyThread_type_lock lock)
24782 PyThread_acquire_lock(lock, 1);
24783 result = (*acquisition_count)--;
24784 PyThread_release_lock(lock);
24787 static CYTHON_INLINE
void
24788 __Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice,
int have_gil,
int lineno)
24791 struct __pyx_memoryview_obj *memview = memslice->memview;
24792 if (unlikely(!memview || (PyObject *) memview == Py_None))
24794 if (unlikely(__pyx_get_slice_count(memview) < 0))
24795 __pyx_fatalerror(
"Acquisition count is %d (line %d)",
24796 __pyx_get_slice_count(memview), lineno);
24797 first_time = __pyx_add_acquisition_count(memview) == 0;
24798 if (unlikely(first_time)) {
24800 Py_INCREF((PyObject *) memview);
24802 PyGILState_STATE _gilstate = PyGILState_Ensure();
24803 Py_INCREF((PyObject *) memview);
24804 PyGILState_Release(_gilstate);
24808 static CYTHON_INLINE
void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *memslice,
24809 int have_gil,
int lineno) {
24811 struct __pyx_memoryview_obj *memview = memslice->memview;
24812 if (unlikely(!memview || (PyObject *) memview == Py_None)) {
24813 memslice->memview = NULL;
24816 if (unlikely(__pyx_get_slice_count(memview) <= 0))
24817 __pyx_fatalerror(
"Acquisition count is %d (line %d)",
24818 __pyx_get_slice_count(memview), lineno);
24819 last_time = __pyx_sub_acquisition_count(memview) == 1;
24820 memslice->data = NULL;
24821 if (unlikely(last_time)) {
24823 Py_CLEAR(memslice->memview);
24825 PyGILState_STATE _gilstate = PyGILState_Ensure();
24826 Py_CLEAR(memslice->memview);
24827 PyGILState_Release(_gilstate);
24830 memslice->memview = NULL;
24835 static void __Pyx_RaiseBufferIndexError(
int axis) {
24836 PyErr_Format(PyExc_IndexError,
24837 "Out of bounds on buffer access (axis %d)", axis);
24841 static void __Pyx_WriteUnraisable(
const char *name, CYTHON_UNUSED
int clineno,
24842 CYTHON_UNUSED
int lineno, CYTHON_UNUSED
const char *filename,
24843 int full_traceback, CYTHON_UNUSED
int nogil) {
24844 PyObject *old_exc, *old_val, *old_tb;
24846 __Pyx_PyThreadState_declare
24848 PyGILState_STATE state;
24850 state = PyGILState_Ensure();
24852 else state = (PyGILState_STATE)-1;
24855 __Pyx_PyThreadState_assign
24856 __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
24857 if (full_traceback) {
24858 Py_XINCREF(old_exc);
24859 Py_XINCREF(old_val);
24860 Py_XINCREF(old_tb);
24861 __Pyx_ErrRestore(old_exc, old_val, old_tb);
24864 #if PY_MAJOR_VERSION < 3
24865 ctx = PyString_FromString(name);
24867 ctx = PyUnicode_FromString(name);
24869 __Pyx_ErrRestore(old_exc, old_val, old_tb);
24871 PyErr_WriteUnraisable(Py_None);
24873 PyErr_WriteUnraisable(ctx);
24878 PyGILState_Release(state);
24883 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
24884 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
24886 value = PyDict_GetItemWithError(d, key);
24887 if (unlikely(!value)) {
24888 if (!PyErr_Occurred()) {
24889 if (unlikely(PyTuple_Check(key))) {
24890 PyObject* args = PyTuple_Pack(1, key);
24891 if (likely(args)) {
24892 PyErr_SetObject(PyExc_KeyError, args);
24896 PyErr_SetObject(PyExc_KeyError, key);
24907 static CYTHON_INLINE
void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
24908 PyErr_Format(PyExc_ValueError,
24909 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T
"d)", expected);
24913 static CYTHON_INLINE
void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
24914 PyErr_Format(PyExc_ValueError,
24915 "need more than %" CYTHON_FORMAT_SSIZE_T
"d value%.1s to unpack",
24916 index, (index == 1) ?
"" :
"s");
24920 static CYTHON_INLINE
void __Pyx_RaiseNoneNotIterableError(
void) {
24921 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not iterable");
24925 #if CYTHON_USE_EXC_INFO_STACK
24926 static _PyErr_StackItem *
24927 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
24929 _PyErr_StackItem *exc_info = tstate->exc_info;
24930 while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
24931 exc_info->previous_item != NULL)
24933 exc_info = exc_info->previous_item;
24940 #if CYTHON_FAST_THREAD_STATE
24941 static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
24942 #if CYTHON_USE_EXC_INFO_STACK
24943 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
24944 *type = exc_info->exc_type;
24945 *value = exc_info->exc_value;
24946 *tb = exc_info->exc_traceback;
24948 *type = tstate->exc_type;
24949 *value = tstate->exc_value;
24950 *tb = tstate->exc_traceback;
24953 Py_XINCREF(*value);
24956 static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
24957 PyObject *tmp_type, *tmp_value, *tmp_tb;
24958 #if CYTHON_USE_EXC_INFO_STACK
24959 _PyErr_StackItem *exc_info = tstate->exc_info;
24960 tmp_type = exc_info->exc_type;
24961 tmp_value = exc_info->exc_value;
24962 tmp_tb = exc_info->exc_traceback;
24963 exc_info->exc_type = type;
24964 exc_info->exc_value = value;
24965 exc_info->exc_traceback = tb;
24967 tmp_type = tstate->exc_type;
24968 tmp_value = tstate->exc_value;
24969 tmp_tb = tstate->exc_traceback;
24970 tstate->exc_type = type;
24971 tstate->exc_value = value;
24972 tstate->exc_traceback = tb;
24974 Py_XDECREF(tmp_type);
24975 Py_XDECREF(tmp_value);
24976 Py_XDECREF(tmp_tb);
24981 #if CYTHON_FAST_THREAD_STATE
24982 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
24984 n = PyTuple_GET_SIZE(tuple);
24985 #if PY_MAJOR_VERSION >= 3
24986 for (i=0; i<
n; i++) {
24987 if (exc_type == PyTuple_GET_ITEM(tuple, i))
return 1;
24990 for (i=0; i<
n; i++) {
24991 if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i)))
return 1;
24995 static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
24996 PyObject *exc_type = tstate->curexc_type;
24997 if (exc_type == err)
return 1;
24998 if (unlikely(!exc_type))
return 0;
24999 if (unlikely(PyTuple_Check(err)))
25000 return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
25001 return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
25006 #if CYTHON_FAST_THREAD_STATE
25007 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
25009 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
25012 PyObject *local_type, *local_value, *local_tb;
25013 #if CYTHON_FAST_THREAD_STATE
25014 PyObject *tmp_type, *tmp_value, *tmp_tb;
25015 local_type = tstate->curexc_type;
25016 local_value = tstate->curexc_value;
25017 local_tb = tstate->curexc_traceback;
25018 tstate->curexc_type = 0;
25019 tstate->curexc_value = 0;
25020 tstate->curexc_traceback = 0;
25022 PyErr_Fetch(&local_type, &local_value, &local_tb);
25024 PyErr_NormalizeException(&local_type, &local_value, &local_tb);
25025 #if CYTHON_FAST_THREAD_STATE
25026 if (unlikely(tstate->curexc_type))
25028 if (unlikely(PyErr_Occurred()))
25031 #if PY_MAJOR_VERSION >= 3
25033 if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
25037 Py_XINCREF(local_tb);
25038 Py_XINCREF(local_type);
25039 Py_XINCREF(local_value);
25040 *type = local_type;
25041 *value = local_value;
25043 #if CYTHON_FAST_THREAD_STATE
25044 #if CYTHON_USE_EXC_INFO_STACK
25046 _PyErr_StackItem *exc_info = tstate->exc_info;
25047 tmp_type = exc_info->exc_type;
25048 tmp_value = exc_info->exc_value;
25049 tmp_tb = exc_info->exc_traceback;
25050 exc_info->exc_type = local_type;
25051 exc_info->exc_value = local_value;
25052 exc_info->exc_traceback = local_tb;
25055 tmp_type = tstate->exc_type;
25056 tmp_value = tstate->exc_value;
25057 tmp_tb = tstate->exc_traceback;
25058 tstate->exc_type = local_type;
25059 tstate->exc_value = local_value;
25060 tstate->exc_traceback = local_tb;
25062 Py_XDECREF(tmp_type);
25063 Py_XDECREF(tmp_value);
25064 Py_XDECREF(tmp_tb);
25066 PyErr_SetExcInfo(local_type, local_value, local_tb);
25073 Py_XDECREF(local_type);
25074 Py_XDECREF(local_value);
25075 Py_XDECREF(local_tb);
25080 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject*
function, PyObject* arg1, PyObject* arg2) {
25081 PyObject *args, *result = NULL;
25082 #if CYTHON_FAST_PYCALL
25083 if (PyFunction_Check(
function)) {
25084 PyObject *args[2] = {arg1, arg2};
25085 return __Pyx_PyFunction_FastCall(
function, args, 2);
25088 #if CYTHON_FAST_PYCCALL
25089 if (__Pyx_PyFastCFunction_Check(
function)) {
25090 PyObject *args[2] = {arg1, arg2};
25091 return __Pyx_PyCFunction_FastCall(
function, args, 2);
25094 args = PyTuple_New(2);
25095 if (unlikely(!args))
goto done;
25097 PyTuple_SET_ITEM(args, 0, arg1);
25099 PyTuple_SET_ITEM(args, 1, arg2);
25100 Py_INCREF(
function);
25101 result = __Pyx_PyObject_Call(
function, args, NULL);
25103 Py_DECREF(
function);
25109 static CYTHON_INLINE
int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2,
int equals) {
25110 #if CYTHON_COMPILING_IN_PYPY
25111 return PyObject_RichCompareBool(s1, s2, equals);
25114 return (equals == Py_EQ);
25115 }
else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
25116 const char *ps1, *ps2;
25117 Py_ssize_t length = PyBytes_GET_SIZE(s1);
25118 if (length != PyBytes_GET_SIZE(s2))
25119 return (equals == Py_NE);
25120 ps1 = PyBytes_AS_STRING(s1);
25121 ps2 = PyBytes_AS_STRING(s2);
25122 if (ps1[0] != ps2[0]) {
25123 return (equals == Py_NE);
25124 }
else if (length == 1) {
25125 return (equals == Py_EQ);
25128 #if CYTHON_USE_UNICODE_INTERNALS
25129 Py_hash_t hash1, hash2;
25130 hash1 = ((PyBytesObject*)s1)->ob_shash;
25131 hash2 = ((PyBytesObject*)s2)->ob_shash;
25132 if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
25133 return (equals == Py_NE);
25136 result = memcmp(ps1, ps2, (
size_t)length);
25137 return (equals == Py_EQ) ? (result == 0) : (result != 0);
25139 }
else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
25140 return (equals == Py_NE);
25141 }
else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
25142 return (equals == Py_NE);
25145 PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
25148 result = __Pyx_PyObject_IsTrue(py_result);
25149 Py_DECREF(py_result);
25156 static CYTHON_INLINE
int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2,
int equals) {
25157 #if CYTHON_COMPILING_IN_PYPY
25158 return PyObject_RichCompareBool(s1, s2, equals);
25160 #if PY_MAJOR_VERSION < 3
25161 PyObject* owned_ref = NULL;
25163 int s1_is_unicode, s2_is_unicode;
25167 s1_is_unicode = PyUnicode_CheckExact(s1);
25168 s2_is_unicode = PyUnicode_CheckExact(s2);
25169 #if PY_MAJOR_VERSION < 3
25170 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
25171 owned_ref = PyUnicode_FromObject(s2);
25172 if (unlikely(!owned_ref))
25176 }
else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
25177 owned_ref = PyUnicode_FromObject(s1);
25178 if (unlikely(!owned_ref))
25182 }
else if (((!s2_is_unicode) & (!s1_is_unicode))) {
25183 return __Pyx_PyBytes_Equals(s1, s2, equals);
25186 if (s1_is_unicode & s2_is_unicode) {
25189 void *data1, *data2;
25190 if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
25192 length = __Pyx_PyUnicode_GET_LENGTH(s1);
25193 if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
25196 #if CYTHON_USE_UNICODE_INTERNALS
25198 Py_hash_t hash1, hash2;
25199 #if CYTHON_PEP393_ENABLED
25200 hash1 = ((PyASCIIObject*)s1)->hash;
25201 hash2 = ((PyASCIIObject*)s2)->hash;
25203 hash1 = ((PyUnicodeObject*)s1)->hash;
25204 hash2 = ((PyUnicodeObject*)s2)->hash;
25206 if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
25211 kind = __Pyx_PyUnicode_KIND(s1);
25212 if (kind != __Pyx_PyUnicode_KIND(s2)) {
25215 data1 = __Pyx_PyUnicode_DATA(s1);
25216 data2 = __Pyx_PyUnicode_DATA(s2);
25217 if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
25219 }
else if (length == 1) {
25222 int result = memcmp(data1, data2, (
size_t)(length * kind));
25223 #if PY_MAJOR_VERSION < 3
25224 Py_XDECREF(owned_ref);
25226 return (equals == Py_EQ) ? (result == 0) : (result != 0);
25228 }
else if ((s1 == Py_None) & s2_is_unicode) {
25230 }
else if ((s2 == Py_None) & s1_is_unicode) {
25234 PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
25235 #if PY_MAJOR_VERSION < 3
25236 Py_XDECREF(owned_ref);
25240 result = __Pyx_PyObject_IsTrue(py_result);
25241 Py_DECREF(py_result);
25245 #if PY_MAJOR_VERSION < 3
25246 Py_XDECREF(owned_ref);
25248 return (equals == Py_EQ);
25250 #if PY_MAJOR_VERSION < 3
25251 Py_XDECREF(owned_ref);
25253 return (equals == Py_NE);
25258 static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) {
25259 Py_ssize_t
q = a / b;
25260 Py_ssize_t
r = a -
q*b;
25261 q -= ((
r != 0) & ((
r ^ b) < 0));
25266 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *
n) {
25267 #if CYTHON_USE_TYPE_SLOTS
25268 #if PY_MAJOR_VERSION >= 3
25269 if (likely(PyUnicode_Check(
n)))
25271 if (likely(PyString_Check(
n)))
25273 return __Pyx_PyObject_GetAttrStr(o,
n);
25275 return PyObject_GetAttr(o,
n);
25279 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
25281 if (!j)
return NULL;
25282 r = PyObject_GetItem(o, j);
25286 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
25287 CYTHON_NCP_UNUSED
int wraparound,
25288 CYTHON_NCP_UNUSED
int boundscheck) {
25289 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
25290 Py_ssize_t wrapped_i = i;
25291 if (wraparound & unlikely(i < 0)) {
25292 wrapped_i += PyList_GET_SIZE(o);
25294 if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
25295 PyObject *
r = PyList_GET_ITEM(o, wrapped_i);
25299 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
25301 return PySequence_GetItem(o, i);
25304 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
25305 CYTHON_NCP_UNUSED
int wraparound,
25306 CYTHON_NCP_UNUSED
int boundscheck) {
25307 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
25308 Py_ssize_t wrapped_i = i;
25309 if (wraparound & unlikely(i < 0)) {
25310 wrapped_i += PyTuple_GET_SIZE(o);
25312 if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
25313 PyObject *
r = PyTuple_GET_ITEM(o, wrapped_i);
25317 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
25319 return PySequence_GetItem(o, i);
25322 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
int is_list,
25323 CYTHON_NCP_UNUSED
int wraparound,
25324 CYTHON_NCP_UNUSED
int boundscheck) {
25325 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
25326 if (is_list || PyList_CheckExact(o)) {
25327 Py_ssize_t
n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
25328 if ((!boundscheck) || (likely(__Pyx_is_valid_index(
n, PyList_GET_SIZE(o))))) {
25329 PyObject *
r = PyList_GET_ITEM(o,
n);
25334 else if (PyTuple_CheckExact(o)) {
25335 Py_ssize_t
n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
25336 if ((!boundscheck) || likely(__Pyx_is_valid_index(
n, PyTuple_GET_SIZE(o)))) {
25337 PyObject *
r = PyTuple_GET_ITEM(o,
n);
25342 PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
25343 if (likely(m && m->sq_item)) {
25344 if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
25345 Py_ssize_t l = m->sq_length(o);
25346 if (likely(l >= 0)) {
25349 if (!PyErr_ExceptionMatches(PyExc_OverflowError))
25354 return m->sq_item(o, i);
25358 if (is_list || PySequence_Check(o)) {
25359 return PySequence_GetItem(o, i);
25362 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
25366 #if CYTHON_USE_TYPE_SLOTS
25367 static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
25369 Py_ssize_t key_value;
25370 PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
25371 if (unlikely(!(m && m->sq_item))) {
25372 PyErr_Format(PyExc_TypeError,
"'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
25375 key_value = __Pyx_PyIndex_AsSsize_t(index);
25376 if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
25377 return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
25379 if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
25381 PyErr_Format(PyExc_IndexError,
"cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
25385 static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
25386 PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
25387 if (likely(m && m->mp_subscript)) {
25388 return m->mp_subscript(obj, key);
25390 return __Pyx_PyObject_GetIndex(obj, key);
25395 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
25396 const char* cstring, Py_ssize_t start, Py_ssize_t stop,
25397 const char* encoding,
const char* errors,
25398 PyObject* (*decode_func)(
const char *
s, Py_ssize_t size,
const char *errors)) {
25400 if (unlikely((start < 0) | (stop < 0))) {
25401 size_t slen = strlen(cstring);
25402 if (unlikely(slen > (
size_t) PY_SSIZE_T_MAX)) {
25403 PyErr_SetString(PyExc_OverflowError,
25404 "c-string too long to convert to Python");
25407 length = (Py_ssize_t) slen;
25416 if (unlikely(stop <= start))
25417 return __Pyx_NewRef(__pyx_empty_unicode);
25418 length = stop - start;
25421 return decode_func(cstring, length, errors);
25423 return PyUnicode_Decode(cstring, length, encoding, errors);
25428 static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
25429 __Pyx_PyThreadState_declare
25430 __Pyx_PyThreadState_assign
25431 if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
25433 __Pyx_PyErr_Clear();
25437 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *
n, PyObject *d) {
25438 PyObject *
r = __Pyx_GetAttr(o,
n);
25439 return (likely(
r)) ?
r : __Pyx_GetAttr3Default(d);
25443 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
25444 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
25445 PyObject *dict = Py_TYPE(obj)->tp_dict;
25446 return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
25448 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
25449 PyObject **dictptr = NULL;
25450 Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
25452 #if CYTHON_COMPILING_IN_CPYTHON
25453 dictptr = (likely(offset > 0)) ? (PyObject **) ((
char *)obj + offset) : _PyObject_GetDictPtr(obj);
25455 dictptr = _PyObject_GetDictPtr(obj);
25458 return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
25460 static CYTHON_INLINE
int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
25461 PyObject *dict = Py_TYPE(obj)->tp_dict;
25462 if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
25464 return obj_dict_version == __Pyx_get_object_dict_version(obj);
25469 #if CYTHON_USE_DICT_VERSIONS
25470 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
25472 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
25476 #if !CYTHON_AVOID_BORROWED_REFS
25477 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
25478 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
25479 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
25480 if (likely(result)) {
25481 return __Pyx_NewRef(result);
25482 }
else if (unlikely(PyErr_Occurred())) {
25486 result = PyDict_GetItem(__pyx_d, name);
25487 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
25488 if (likely(result)) {
25489 return __Pyx_NewRef(result);
25493 result = PyObject_GetItem(__pyx_d, name);
25494 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
25495 if (likely(result)) {
25496 return __Pyx_NewRef(result);
25500 return __Pyx_GetBuiltinName(name);
25504 #if CYTHON_FAST_THREAD_STATE
25505 static CYTHON_INLINE
void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
25506 PyObject *tmp_type, *tmp_value, *tmp_tb;
25507 #if CYTHON_USE_EXC_INFO_STACK
25508 _PyErr_StackItem *exc_info = tstate->exc_info;
25509 tmp_type = exc_info->exc_type;
25510 tmp_value = exc_info->exc_value;
25511 tmp_tb = exc_info->exc_traceback;
25512 exc_info->exc_type = *type;
25513 exc_info->exc_value = *value;
25514 exc_info->exc_traceback = *tb;
25516 tmp_type = tstate->exc_type;
25517 tmp_value = tstate->exc_value;
25518 tmp_tb = tstate->exc_traceback;
25519 tstate->exc_type = *type;
25520 tstate->exc_value = *value;
25521 tstate->exc_traceback = *tb;
25524 *value = tmp_value;
25528 static CYTHON_INLINE
void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
25529 PyObject *tmp_type, *tmp_value, *tmp_tb;
25530 PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
25531 PyErr_SetExcInfo(*type, *value, *tb);
25533 *value = tmp_value;
25539 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list,
int level) {
25540 PyObject *empty_list = 0;
25541 PyObject *module = 0;
25542 PyObject *global_dict = 0;
25543 PyObject *empty_dict = 0;
25545 #if PY_MAJOR_VERSION < 3
25546 PyObject *py_import;
25547 py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
25554 empty_list = PyList_New(0);
25559 global_dict = PyModule_GetDict(__pyx_m);
25562 empty_dict = PyDict_New();
25566 #if PY_MAJOR_VERSION >= 3
25568 if ((1) && (strchr(__Pyx_MODULE_NAME,
'.'))) {
25569 module = PyImport_ImportModuleLevelObject(
25570 name, global_dict, empty_dict, list, 1);
25572 if (!PyErr_ExceptionMatches(PyExc_ImportError))
25581 #if PY_MAJOR_VERSION < 3
25582 PyObject *py_level = PyInt_FromLong(level);
25585 module = PyObject_CallFunctionObjArgs(py_import,
25586 name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
25587 Py_DECREF(py_level);
25589 module = PyImport_ImportModuleLevelObject(
25590 name, global_dict, empty_dict, list, level);
25595 #if PY_MAJOR_VERSION < 3
25596 Py_XDECREF(py_import);
25598 Py_XDECREF(empty_list);
25599 Py_XDECREF(empty_dict);
25604 #if CYTHON_COMPILING_IN_CPYTHON
25605 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
25611 return b == &PyBaseObject_Type;
25613 static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
25615 if (a == b)
return 1;
25619 n = PyTuple_GET_SIZE(mro);
25620 for (i = 0; i <
n; i++) {
25621 if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
25626 return __Pyx_InBases(a, b);
25628 #if PY_MAJOR_VERSION == 2
25629 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
25630 PyObject *exception, *value, *tb;
25632 __Pyx_PyThreadState_declare
25633 __Pyx_PyThreadState_assign
25634 __Pyx_ErrFetch(&exception, &value, &tb);
25635 res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
25636 if (unlikely(res == -1)) {
25637 PyErr_WriteUnraisable(err);
25641 res = PyObject_IsSubclass(err, exc_type2);
25642 if (unlikely(res == -1)) {
25643 PyErr_WriteUnraisable(err);
25647 __Pyx_ErrRestore(exception, value, tb);
25651 static CYTHON_INLINE
int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
25652 int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
25654 res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
25659 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
25661 assert(PyExceptionClass_Check(exc_type));
25662 n = PyTuple_GET_SIZE(tuple);
25663 #if PY_MAJOR_VERSION >= 3
25664 for (i=0; i<
n; i++) {
25665 if (exc_type == PyTuple_GET_ITEM(tuple, i))
return 1;
25668 for (i=0; i<
n; i++) {
25669 PyObject *t = PyTuple_GET_ITEM(tuple, i);
25670 #if PY_MAJOR_VERSION < 3
25671 if (likely(exc_type == t))
return 1;
25673 if (likely(PyExceptionClass_Check(t))) {
25674 if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t))
return 1;
25680 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
25681 if (likely(err == exc_type))
return 1;
25682 if (likely(PyExceptionClass_Check(err))) {
25683 if (likely(PyExceptionClass_Check(exc_type))) {
25684 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
25685 }
else if (likely(PyTuple_Check(exc_type))) {
25686 return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
25690 return PyErr_GivenExceptionMatches(err, exc_type);
25692 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
25693 assert(PyExceptionClass_Check(exc_type1));
25694 assert(PyExceptionClass_Check(exc_type2));
25695 if (likely(err == exc_type1 || err == exc_type2))
return 1;
25696 if (likely(PyExceptionClass_Check(err))) {
25697 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
25699 return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
25704 #if !CYTHON_COMPILING_IN_PYPY
25705 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED
long intval,
int inplace,
int zerodivision_check) {
25707 (void)zerodivision_check;
25708 #if PY_MAJOR_VERSION < 3
25709 if (likely(PyInt_CheckExact(op1))) {
25710 const long b = intval;
25712 long a = PyInt_AS_LONG(op1);
25713 x = (long)((
unsigned long)a + b);
25714 if (likely((x^a) >= 0 || (x^b) >= 0))
25715 return PyInt_FromLong(x);
25716 return PyLong_Type.tp_as_number->nb_add(op1, op2);
25719 #if CYTHON_USE_PYLONG_INTERNALS
25720 if (likely(PyLong_CheckExact(op1))) {
25721 const long b = intval;
25723 #ifdef HAVE_LONG_LONG
25724 const PY_LONG_LONG llb = intval;
25725 PY_LONG_LONG lla, llx;
25727 const digit* digits = ((PyLongObject*)op1)->ob_digit;
25728 const Py_ssize_t size = Py_SIZE(op1);
25729 if (likely(__Pyx_sst_abs(size) <= 1)) {
25730 a = likely(size) ? digits[0] : 0;
25731 if (size == -1) a = -a;
25735 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
25736 a = -(long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
25738 #ifdef HAVE_LONG_LONG
25739 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
25740 lla = -(PY_LONG_LONG) (((((
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
25744 CYTHON_FALLTHROUGH;
25746 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
25747 a = (long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
25749 #ifdef HAVE_LONG_LONG
25750 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
25751 lla = (PY_LONG_LONG) (((((
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
25755 CYTHON_FALLTHROUGH;
25757 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
25758 a = -(long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
25760 #ifdef HAVE_LONG_LONG
25761 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
25762 lla = -(PY_LONG_LONG) (((((((
unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
25766 CYTHON_FALLTHROUGH;
25768 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
25769 a = (long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
25771 #ifdef HAVE_LONG_LONG
25772 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
25773 lla = (PY_LONG_LONG) (((((((
unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
25777 CYTHON_FALLTHROUGH;
25779 if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
25780 a = -(long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
25782 #ifdef HAVE_LONG_LONG
25783 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
25784 lla = -(PY_LONG_LONG) (((((((((
unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
25788 CYTHON_FALLTHROUGH;
25790 if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
25791 a = (long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
25793 #ifdef HAVE_LONG_LONG
25794 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
25795 lla = (PY_LONG_LONG) (((((((((
unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
25799 CYTHON_FALLTHROUGH;
25800 default:
return PyLong_Type.tp_as_number->nb_add(op1, op2);
25804 return PyLong_FromLong(x);
25805 #ifdef HAVE_LONG_LONG
25808 return PyLong_FromLongLong(llx);
25814 if (PyFloat_CheckExact(op1)) {
25815 const long b = intval;
25816 double a = PyFloat_AS_DOUBLE(op1);
25818 PyFPE_START_PROTECT(
"add",
return NULL)
25819 result = ((double)a) + (double)b;
25820 PyFPE_END_PROTECT(result)
25821 return PyFloat_FromDouble(result);
25823 return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
25828 static CYTHON_INLINE
void __Pyx_RaiseUnboundLocalError(
const char *varname) {
25829 PyErr_Format(PyExc_UnboundLocalError,
"local variable '%s' referenced before assignment", varname);
25833 static CYTHON_INLINE
long __Pyx_div_long(
long a,
long b) {
25836 q -= ((
r != 0) & ((
r ^ b) < 0));
25841 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
25842 PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
25843 if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
25844 PyErr_Format(PyExc_ImportError,
25845 #
if PY_MAJOR_VERSION < 3
25846 "cannot import name %.230s", PyString_AS_STRING(name));
25848 "cannot import name %S", name);
25855 static CYTHON_INLINE
int __Pyx_HasAttr(PyObject *o, PyObject *
n) {
25857 if (unlikely(!__Pyx_PyBaseString_Check(
n))) {
25858 PyErr_SetString(PyExc_TypeError,
25859 "hasattr(): attribute name must be string");
25862 r = __Pyx_GetAttr(o,
n);
25863 if (unlikely(!
r)) {
25873 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
25874 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
25875 PyErr_Format(PyExc_AttributeError,
25876 #
if PY_MAJOR_VERSION >= 3
25877 "'%.50s' object has no attribute '%U'",
25878 tp->tp_name, attr_name);
25880 "'%.50s' object has no attribute '%.400s'",
25881 tp->tp_name, PyString_AS_STRING(attr_name));
25885 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
25887 PyTypeObject *tp = Py_TYPE(obj);
25888 if (unlikely(!PyString_Check(attr_name))) {
25889 return PyObject_GenericGetAttr(obj, attr_name);
25891 assert(!tp->tp_dictoffset);
25892 descr = _PyType_Lookup(tp, attr_name);
25893 if (unlikely(!descr)) {
25894 return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
25897 #if PY_MAJOR_VERSION < 3
25898 if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
25901 descrgetfunc
f = Py_TYPE(descr)->tp_descr_get;
25903 PyObject *res =
f(descr, obj, (PyObject *)tp);
25913 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
25914 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
25915 if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
25916 return PyObject_GenericGetAttr(obj, attr_name);
25918 return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
25923 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(
void) {
25924 __Pyx_PyThreadState_declare
25925 __Pyx_PyThreadState_assign
25926 if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
25927 __Pyx_PyErr_Clear();
25929 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
25931 #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1
25932 PyTypeObject* tp = Py_TYPE(obj);
25933 if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
25934 return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
25937 result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
25938 if (unlikely(!result)) {
25939 __Pyx_PyObject_GetAttrStr_ClearAttributeError();
25945 static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
25947 PyObject *name_attr;
25948 name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name_2);
25949 if (likely(name_attr)) {
25950 ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
25954 if (unlikely(ret < 0)) {
25958 Py_XDECREF(name_attr);
25961 static int __Pyx_setup_reduce(PyObject* type_obj) {
25963 PyObject *object_reduce = NULL;
25964 PyObject *object_reduce_ex = NULL;
25965 PyObject *reduce = NULL;
25966 PyObject *reduce_ex = NULL;
25967 PyObject *reduce_cython = NULL;
25968 PyObject *setstate = NULL;
25969 PyObject *setstate_cython = NULL;
25970 #if CYTHON_USE_PYTYPE_LOOKUP
25971 if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate))
goto __PYX_GOOD;
25973 if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate))
goto __PYX_GOOD;
25975 #if CYTHON_USE_PYTYPE_LOOKUP
25976 object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex);
if (!object_reduce_ex)
goto __PYX_BAD;
25978 object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex);
if (!object_reduce_ex)
goto __PYX_BAD;
25980 reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex);
if (unlikely(!reduce_ex))
goto __PYX_BAD;
25981 if (reduce_ex == object_reduce_ex) {
25982 #if CYTHON_USE_PYTYPE_LOOKUP
25983 object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce);
if (!object_reduce)
goto __PYX_BAD;
25985 object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce);
if (!object_reduce)
goto __PYX_BAD;
25987 reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce);
if (unlikely(!reduce))
goto __PYX_BAD;
25988 if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
25989 reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython);
25990 if (likely(reduce_cython)) {
25991 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython);
if (unlikely(ret < 0))
goto __PYX_BAD;
25992 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython);
if (unlikely(ret < 0))
goto __PYX_BAD;
25993 }
else if (reduce == object_reduce || PyErr_Occurred()) {
25996 setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
25997 if (!setstate) PyErr_Clear();
25998 if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
25999 setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython);
26000 if (likely(setstate_cython)) {
26001 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython);
if (unlikely(ret < 0))
goto __PYX_BAD;
26002 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython);
if (unlikely(ret < 0))
goto __PYX_BAD;
26003 }
else if (!setstate || PyErr_Occurred()) {
26007 PyType_Modified((PyTypeObject*)type_obj);
26012 if (!PyErr_Occurred())
26013 PyErr_Format(PyExc_RuntimeError,
"Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
26016 #if !CYTHON_USE_PYTYPE_LOOKUP
26017 Py_XDECREF(object_reduce);
26018 Py_XDECREF(object_reduce_ex);
26020 Py_XDECREF(reduce);
26021 Py_XDECREF(reduce_ex);
26022 Py_XDECREF(reduce_cython);
26023 Py_XDECREF(setstate);
26024 Py_XDECREF(setstate_cython);
26029 static int __Pyx_SetVtable(PyObject *dict,
void *vtable) {
26030 #if PY_VERSION_HEX >= 0x02070000
26031 PyObject *ob = PyCapsule_New(vtable, 0, 0);
26033 PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
26037 if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
26047 #ifndef __PYX_HAVE_RT_ImportType
26048 #define __PYX_HAVE_RT_ImportType
26049 static PyTypeObject *__Pyx_ImportType(PyObject *module,
const char *module_name,
const char *class_name,
26050 size_t size,
enum __Pyx_ImportType_CheckSize check_size)
26052 PyObject *result = 0;
26054 Py_ssize_t basicsize;
26055 #ifdef Py_LIMITED_API
26056 PyObject *py_basicsize;
26058 result = PyObject_GetAttrString(module, class_name);
26061 if (!PyType_Check(result)) {
26062 PyErr_Format(PyExc_TypeError,
26063 "%.200s.%.200s is not a type object",
26064 module_name, class_name);
26067 #ifndef Py_LIMITED_API
26068 basicsize = ((PyTypeObject *)result)->tp_basicsize;
26070 py_basicsize = PyObject_GetAttrString(result,
"__basicsize__");
26073 basicsize = PyLong_AsSsize_t(py_basicsize);
26074 Py_DECREF(py_basicsize);
26076 if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
26079 if ((
size_t)basicsize < size) {
26080 PyErr_Format(PyExc_ValueError,
26081 "%.200s.%.200s size changed, may indicate binary incompatibility. "
26082 "Expected %zd from C header, got %zd from PyObject",
26083 module_name, class_name, size, basicsize);
26086 if (check_size == __Pyx_ImportType_CheckSize_Error && (
size_t)basicsize != size) {
26087 PyErr_Format(PyExc_ValueError,
26088 "%.200s.%.200s size changed, may indicate binary incompatibility. "
26089 "Expected %zd from C header, got %zd from PyObject",
26090 module_name, class_name, size, basicsize);
26093 else if (check_size == __Pyx_ImportType_CheckSize_Warn && (
size_t)basicsize > size) {
26094 PyOS_snprintf(warning,
sizeof(warning),
26095 "%s.%s size changed, may indicate binary incompatibility. "
26096 "Expected %zd from C header, got %zd from PyObject",
26097 module_name, class_name, size, basicsize);
26098 if (PyErr_WarnEx(NULL, warning, 0) < 0)
goto bad;
26100 return (PyTypeObject *)result;
26102 Py_XDECREF(result);
26108 static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
26109 Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases);
26110 for (i=0; i < nbases; i++) {
26111 PyTypeObject *tmptype;
26112 PyObject *tmp = PyTuple_GET_ITEM(bases, i);
26113 tmptype = Py_TYPE(tmp);
26114 #if PY_MAJOR_VERSION < 3
26115 if (tmptype == &PyClass_Type)
26119 metaclass = tmptype;
26122 if (PyType_IsSubtype(metaclass, tmptype))
26124 if (PyType_IsSubtype(tmptype, metaclass)) {
26125 metaclass = tmptype;
26128 PyErr_SetString(PyExc_TypeError,
26129 "metaclass conflict: "
26130 "the metaclass of a derived class "
26131 "must be a (non-strict) subclass "
26132 "of the metaclasses of all its bases");
26136 #if PY_MAJOR_VERSION < 3
26137 metaclass = &PyClass_Type;
26139 metaclass = &PyType_Type;
26142 Py_INCREF((PyObject*) metaclass);
26143 return (PyObject*) metaclass;
26147 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
26148 PyObject* fake_module;
26149 PyTypeObject* cached_type = NULL;
26150 fake_module = PyImport_AddModule((
char*)
"_cython_" CYTHON_ABI);
26151 if (!fake_module)
return NULL;
26152 Py_INCREF(fake_module);
26153 cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
26155 if (!PyType_Check((PyObject*)cached_type)) {
26156 PyErr_Format(PyExc_TypeError,
26157 "Shared Cython type %.200s is not a type object",
26161 if (cached_type->tp_basicsize != type->tp_basicsize) {
26162 PyErr_Format(PyExc_TypeError,
26163 "Shared Cython type %.200s has the wrong size, try recompiling",
26168 if (!PyErr_ExceptionMatches(PyExc_AttributeError))
goto bad;
26170 if (PyType_Ready(type) < 0)
goto bad;
26171 if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
26174 cached_type = type;
26177 Py_DECREF(fake_module);
26178 return cached_type;
26180 Py_XDECREF(cached_type);
26181 cached_type = NULL;
26186 #include <structmember.h>
26188 __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *closure)
26190 if (unlikely(op->func_doc == NULL)) {
26191 if (op->func.m_ml->ml_doc) {
26192 #if PY_MAJOR_VERSION >= 3
26193 op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc);
26195 op->func_doc = PyString_FromString(op->func.m_ml->ml_doc);
26197 if (unlikely(op->func_doc == NULL))
26200 Py_INCREF(Py_None);
26204 Py_INCREF(op->func_doc);
26205 return op->func_doc;
26208 __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED
void *context)
26210 PyObject *tmp = op->func_doc;
26211 if (value == NULL) {
26215 op->func_doc = value;
26220 __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context)
26222 if (unlikely(op->func_name == NULL)) {
26223 #if PY_MAJOR_VERSION >= 3
26224 op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name);
26226 op->func_name = PyString_InternFromString(op->func.m_ml->ml_name);
26228 if (unlikely(op->func_name == NULL))
26231 Py_INCREF(op->func_name);
26232 return op->func_name;
26235 __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED
void *context)
26238 #if PY_MAJOR_VERSION >= 3
26239 if (unlikely(value == NULL || !PyUnicode_Check(value)))
26241 if (unlikely(value == NULL || !PyString_Check(value)))
26244 PyErr_SetString(PyExc_TypeError,
26245 "__name__ must be set to a string object");
26248 tmp = op->func_name;
26250 op->func_name = value;
26255 __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context)
26257 Py_INCREF(op->func_qualname);
26258 return op->func_qualname;
26261 __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED
void *context)
26264 #if PY_MAJOR_VERSION >= 3
26265 if (unlikely(value == NULL || !PyUnicode_Check(value)))
26267 if (unlikely(value == NULL || !PyString_Check(value)))
26270 PyErr_SetString(PyExc_TypeError,
26271 "__qualname__ must be set to a string object");
26274 tmp = op->func_qualname;
26276 op->func_qualname = value;
26281 __Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED
void *closure)
26284 self = m->func_closure;
26291 __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context)
26293 if (unlikely(op->func_dict == NULL)) {
26294 op->func_dict = PyDict_New();
26295 if (unlikely(op->func_dict == NULL))
26298 Py_INCREF(op->func_dict);
26299 return op->func_dict;
26302 __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED
void *context)
26305 if (unlikely(value == NULL)) {
26306 PyErr_SetString(PyExc_TypeError,
26307 "function's dictionary may not be deleted");
26310 if (unlikely(!PyDict_Check(value))) {
26311 PyErr_SetString(PyExc_TypeError,
26312 "setting function's dictionary to a non-dict");
26315 tmp = op->func_dict;
26317 op->func_dict = value;
26322 __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context)
26324 Py_INCREF(op->func_globals);
26325 return op->func_globals;
26328 __Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context)
26330 Py_INCREF(Py_None);
26334 __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context)
26336 PyObject* result = (op->func_code) ? op->func_code : Py_None;
26341 __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
26343 PyObject *res = op->defaults_getter((PyObject *) op);
26344 if (unlikely(!res))
26346 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
26347 op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
26348 Py_INCREF(op->defaults_tuple);
26349 op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
26350 Py_INCREF(op->defaults_kwdict);
26352 op->defaults_tuple = PySequence_ITEM(res, 0);
26353 if (unlikely(!op->defaults_tuple)) result = -1;
26355 op->defaults_kwdict = PySequence_ITEM(res, 1);
26356 if (unlikely(!op->defaults_kwdict)) result = -1;
26363 __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED
void *context) {
26367 }
else if (value != Py_None && !PyTuple_Check(value)) {
26368 PyErr_SetString(PyExc_TypeError,
26369 "__defaults__ must be set to a tuple object");
26373 tmp = op->defaults_tuple;
26374 op->defaults_tuple = value;
26379 __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context) {
26380 PyObject* result = op->defaults_tuple;
26381 if (unlikely(!result)) {
26382 if (op->defaults_getter) {
26383 if (__Pyx_CyFunction_init_defaults(op) < 0)
return NULL;
26384 result = op->defaults_tuple;
26393 __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED
void *context) {
26397 }
else if (value != Py_None && !PyDict_Check(value)) {
26398 PyErr_SetString(PyExc_TypeError,
26399 "__kwdefaults__ must be set to a dict object");
26403 tmp = op->defaults_kwdict;
26404 op->defaults_kwdict = value;
26409 __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context) {
26410 PyObject* result = op->defaults_kwdict;
26411 if (unlikely(!result)) {
26412 if (op->defaults_getter) {
26413 if (__Pyx_CyFunction_init_defaults(op) < 0)
return NULL;
26414 result = op->defaults_kwdict;
26423 __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED
void *context) {
26425 if (!value || value == Py_None) {
26427 }
else if (!PyDict_Check(value)) {
26428 PyErr_SetString(PyExc_TypeError,
26429 "__annotations__ must be set to a dict object");
26433 tmp = op->func_annotations;
26434 op->func_annotations = value;
26439 __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context) {
26440 PyObject* result = op->func_annotations;
26441 if (unlikely(!result)) {
26442 result = PyDict_New();
26443 if (unlikely(!result))
return NULL;
26444 op->func_annotations = result;
26449 static PyGetSetDef __pyx_CyFunction_getsets[] = {
26450 {(
char *)
"func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
26451 {(
char *)
"__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
26452 {(
char *)
"func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
26453 {(
char *)
"__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
26454 {(
char *)
"__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
26455 {(
char *)
"__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0},
26456 {(
char *)
"func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
26457 {(
char *)
"__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
26458 {(
char *)
"func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
26459 {(
char *)
"__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
26460 {(
char *)
"func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
26461 {(
char *)
"__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
26462 {(
char *)
"func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
26463 {(
char *)
"__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
26464 {(
char *)
"func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
26465 {(
char *)
"__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
26466 {(
char *)
"__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
26467 {(
char *)
"__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
26470 static PyMemberDef __pyx_CyFunction_members[] = {
26471 {(
char *)
"__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0},
26475 __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args)
26477 #if PY_MAJOR_VERSION >= 3
26478 return PyUnicode_FromString(m->func.m_ml->ml_name);
26480 return PyString_FromString(m->func.m_ml->ml_name);
26483 static PyMethodDef __pyx_CyFunction_methods[] = {
26484 {
"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
26487 #if PY_VERSION_HEX < 0x030500A0
26488 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
26490 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist)
26492 static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml,
int flags, PyObject* qualname,
26493 PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
26494 if (unlikely(op == NULL))
26497 __Pyx_CyFunction_weakreflist(op) = NULL;
26498 op->func.m_ml = ml;
26499 op->func.m_self = (PyObject *) op;
26500 Py_XINCREF(closure);
26501 op->func_closure = closure;
26502 Py_XINCREF(module);
26503 op->func.m_module = module;
26504 op->func_dict = NULL;
26505 op->func_name = NULL;
26506 Py_INCREF(qualname);
26507 op->func_qualname = qualname;
26508 op->func_doc = NULL;
26509 op->func_classobj = NULL;
26510 op->func_globals = globals;
26511 Py_INCREF(op->func_globals);
26513 op->func_code = code;
26514 op->defaults_pyobjects = 0;
26515 op->defaults_size = 0;
26516 op->defaults = NULL;
26517 op->defaults_tuple = NULL;
26518 op->defaults_kwdict = NULL;
26519 op->defaults_getter = NULL;
26520 op->func_annotations = NULL;
26521 return (PyObject *) op;
26524 __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
26526 Py_CLEAR(m->func_closure);
26527 Py_CLEAR(m->func.m_module);
26528 Py_CLEAR(m->func_dict);
26529 Py_CLEAR(m->func_name);
26530 Py_CLEAR(m->func_qualname);
26531 Py_CLEAR(m->func_doc);
26532 Py_CLEAR(m->func_globals);
26533 Py_CLEAR(m->func_code);
26534 Py_CLEAR(m->func_classobj);
26535 Py_CLEAR(m->defaults_tuple);
26536 Py_CLEAR(m->defaults_kwdict);
26537 Py_CLEAR(m->func_annotations);
26539 PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
26541 for (i = 0; i < m->defaults_pyobjects; i++)
26542 Py_XDECREF(pydefaults[i]);
26543 PyObject_Free(m->defaults);
26544 m->defaults = NULL;
26548 static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
26550 if (__Pyx_CyFunction_weakreflist(m) != NULL)
26551 PyObject_ClearWeakRefs((PyObject *) m);
26552 __Pyx_CyFunction_clear(m);
26553 PyObject_GC_Del(m);
26555 static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
26557 PyObject_GC_UnTrack(m);
26558 __Pyx__CyFunction_dealloc(m);
26560 static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit,
void *arg)
26562 Py_VISIT(m->func_closure);
26563 Py_VISIT(m->func.m_module);
26564 Py_VISIT(m->func_dict);
26565 Py_VISIT(m->func_name);
26566 Py_VISIT(m->func_qualname);
26567 Py_VISIT(m->func_doc);
26568 Py_VISIT(m->func_globals);
26569 Py_VISIT(m->func_code);
26570 Py_VISIT(m->func_classobj);
26571 Py_VISIT(m->defaults_tuple);
26572 Py_VISIT(m->defaults_kwdict);
26574 PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
26576 for (i = 0; i < m->defaults_pyobjects; i++)
26577 Py_VISIT(pydefaults[i]);
26581 static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type)
26583 #if PY_MAJOR_VERSION < 3
26584 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
26585 if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) {
26589 if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) {
26591 type = (PyObject *)(Py_TYPE(obj));
26592 return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type)));
26594 if (obj == Py_None)
26597 return __Pyx_PyMethod_New(func, obj, type);
26600 __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
26602 #if PY_MAJOR_VERSION >= 3
26603 return PyUnicode_FromFormat(
"<cyfunction %U at %p>",
26604 op->func_qualname, (
void *)op);
26606 return PyString_FromFormat(
"<cyfunction %s at %p>",
26607 PyString_AsString(op->func_qualname), (
void *)op);
26610 static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *
self, PyObject *arg, PyObject *kw) {
26611 PyCFunctionObject*
f = (PyCFunctionObject*)func;
26612 PyCFunction meth =
f->m_ml->ml_meth;
26614 switch (
f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
26616 if (likely(kw == NULL || PyDict_Size(kw) == 0))
26617 return (*meth)(
self, arg);
26619 case METH_VARARGS | METH_KEYWORDS:
26620 return (*(PyCFunctionWithKeywords)(
void*)meth)(
self, arg, kw);
26622 if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
26623 size = PyTuple_GET_SIZE(arg);
26624 if (likely(size == 0))
26625 return (*meth)(
self, NULL);
26626 PyErr_Format(PyExc_TypeError,
26627 "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T
"d given)",
26628 f->m_ml->ml_name, size);
26633 if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
26634 size = PyTuple_GET_SIZE(arg);
26635 if (likely(size == 1)) {
26636 PyObject *result, *arg0;
26637 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
26638 arg0 = PyTuple_GET_ITEM(arg, 0);
26640 arg0 = PySequence_ITEM(arg, 0);
if (unlikely(!arg0))
return NULL;
26642 result = (*meth)(
self, arg0);
26643 #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
26648 PyErr_Format(PyExc_TypeError,
26649 "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T
"d given)",
26650 f->m_ml->ml_name, size);
26655 PyErr_SetString(PyExc_SystemError,
"Bad call flags in "
26656 "__Pyx_CyFunction_Call. METH_OLDARGS is no "
26657 "longer supported!");
26660 PyErr_Format(PyExc_TypeError,
"%.200s() takes no keyword arguments",
26664 static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
26665 return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw);
26667 static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
26669 __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
26670 if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
26672 PyObject *new_args;
26674 argc = PyTuple_GET_SIZE(args);
26675 new_args = PyTuple_GetSlice(args, 1, argc);
26676 if (unlikely(!new_args))
26678 self = PyTuple_GetItem(args, 0);
26679 if (unlikely(!
self)) {
26680 Py_DECREF(new_args);
26683 result = __Pyx_CyFunction_CallMethod(func,
self, new_args, kw);
26684 Py_DECREF(new_args);
26686 result = __Pyx_CyFunction_Call(func, args, kw);
26690 static PyTypeObject __pyx_CyFunctionType_type = {
26691 PyVarObject_HEAD_INIT(0, 0)
26692 "cython_function_or_method",
26693 sizeof(__pyx_CyFunctionObject),
26695 (destructor) __Pyx_CyFunction_dealloc,
26699 #if PY_MAJOR_VERSION < 3
26704 (reprfunc) __Pyx_CyFunction_repr,
26709 __Pyx_CyFunction_CallAsMethod,
26714 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
26716 (traverseproc) __Pyx_CyFunction_traverse,
26717 (inquiry) __Pyx_CyFunction_clear,
26719 #
if PY_VERSION_HEX < 0x030500A0
26720 offsetof(__pyx_CyFunctionObject, func_weakreflist),
26722 offsetof(PyCFunctionObject, m_weakreflist),
26726 __pyx_CyFunction_methods,
26727 __pyx_CyFunction_members,
26728 __pyx_CyFunction_getsets,
26731 __Pyx_CyFunction_descr_get,
26733 offsetof(__pyx_CyFunctionObject, func_dict),
26746 #if PY_VERSION_HEX >= 0x030400a1
26749 #if PY_VERSION_HEX >= 0x030800b1
26752 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
26756 static int __pyx_CyFunction_init(
void) {
26757 __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
26758 if (unlikely(__pyx_CyFunctionType == NULL)) {
26763 static CYTHON_INLINE
void *__Pyx_CyFunction_InitDefaults(PyObject *func,
size_t size,
int pyobjects) {
26764 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
26765 m->defaults = PyObject_Malloc(size);
26766 if (unlikely(!m->defaults))
26767 return PyErr_NoMemory();
26768 memset(m->defaults, 0, size);
26769 m->defaults_pyobjects = pyobjects;
26770 m->defaults_size = size;
26771 return m->defaults;
26773 static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
26774 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
26775 m->defaults_tuple = tuple;
26778 static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
26779 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
26780 m->defaults_kwdict = dict;
26783 static CYTHON_INLINE
void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
26784 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
26785 m->func_annotations = dict;
26790 static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
int flags, PyObject* qualname,
26791 PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
26792 PyObject *op = __Pyx_CyFunction_Init(
26793 PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType),
26794 ml, flags, qualname, closure, module, globals, code
26797 PyObject_GC_Track(op);
26803 static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name,
26804 PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) {
26807 PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare);
26809 PyObject *pargs = PyTuple_Pack(2, name, bases);
26810 if (unlikely(!pargs)) {
26814 ns = PyObject_Call(prep, pargs, mkw);
26818 if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError)))
26828 if (unlikely(PyObject_SetItem(
ns, __pyx_n_s_module, modname) < 0))
goto bad;
26829 if (unlikely(PyObject_SetItem(
ns, __pyx_n_s_qualname, qualname) < 0))
goto bad;
26830 if (unlikely(doc && PyObject_SetItem(
ns, __pyx_n_s_doc, doc) < 0))
goto bad;
26836 static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases,
26837 PyObject *dict, PyObject *mkw,
26838 int calculate_metaclass,
int allow_py2_metaclass) {
26839 PyObject *result, *margs;
26840 PyObject *owned_metaclass = NULL;
26841 if (allow_py2_metaclass) {
26842 owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass);
26843 if (owned_metaclass) {
26844 metaclass = owned_metaclass;
26845 }
else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) {
26851 if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) {
26852 metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases);
26853 Py_XDECREF(owned_metaclass);
26854 if (unlikely(!metaclass))
26856 owned_metaclass = metaclass;
26858 margs = PyTuple_Pack(3, name, bases, dict);
26859 if (unlikely(!margs)) {
26862 result = PyObject_Call(metaclass, margs, mkw);
26865 Py_XDECREF(owned_metaclass);
26870 #ifndef CYTHON_CLINE_IN_TRACEBACK
26871 static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate,
int c_line) {
26872 PyObject *use_cline;
26873 PyObject *ptype, *pvalue, *ptraceback;
26874 #if CYTHON_COMPILING_IN_CPYTHON
26875 PyObject **cython_runtime_dict;
26877 if (unlikely(!__pyx_cython_runtime)) {
26880 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
26881 #if CYTHON_COMPILING_IN_CPYTHON
26882 cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
26883 if (likely(cython_runtime_dict)) {
26884 __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
26885 use_cline, *cython_runtime_dict,
26886 __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
26890 PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
26891 if (use_cline_obj) {
26892 use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
26893 Py_DECREF(use_cline_obj);
26901 PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
26903 else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
26906 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
26912 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line) {
26913 int start = 0, mid = 0, end = count - 1;
26914 if (end >= 0 && code_line > entries[end].code_line) {
26917 while (start < end) {
26918 mid = start + (end - start) / 2;
26919 if (code_line < entries[mid].code_line) {
26921 }
else if (code_line > entries[mid].code_line) {
26927 if (code_line <= entries[mid].code_line) {
26933 static PyCodeObject *__pyx_find_code_object(
int code_line) {
26934 PyCodeObject* code_object;
26936 if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
26939 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
26940 if (unlikely(
pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[
pos].code_line != code_line)) {
26943 code_object = __pyx_code_cache.entries[
pos].code_object;
26944 Py_INCREF(code_object);
26945 return code_object;
26947 static void __pyx_insert_code_object(
int code_line, PyCodeObject* code_object) {
26949 __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
26950 if (unlikely(!code_line)) {
26953 if (unlikely(!entries)) {
26954 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*
sizeof(__Pyx_CodeObjectCacheEntry));
26955 if (likely(entries)) {
26956 __pyx_code_cache.entries = entries;
26957 __pyx_code_cache.max_count = 64;
26958 __pyx_code_cache.count = 1;
26959 entries[0].code_line = code_line;
26960 entries[0].code_object = code_object;
26961 Py_INCREF(code_object);
26965 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
26966 if ((
pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[
pos].code_line == code_line)) {
26967 PyCodeObject* tmp = entries[
pos].code_object;
26968 entries[
pos].code_object = code_object;
26972 if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
26973 int new_max = __pyx_code_cache.max_count + 64;
26974 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
26975 __pyx_code_cache.entries, ((
size_t)new_max) *
sizeof(__Pyx_CodeObjectCacheEntry));
26976 if (unlikely(!entries)) {
26979 __pyx_code_cache.entries = entries;
26980 __pyx_code_cache.max_count = new_max;
26982 for (i=__pyx_code_cache.count; i>
pos; i--) {
26983 entries[i] = entries[i-1];
26985 entries[
pos].code_line = code_line;
26986 entries[
pos].code_object = code_object;
26987 __pyx_code_cache.count++;
26988 Py_INCREF(code_object);
26992 #include "compile.h"
26993 #include "frameobject.h"
26994 #include "traceback.h"
26995 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
26996 const char *funcname,
int c_line,
26997 int py_line,
const char *filename) {
26998 PyCodeObject *py_code = 0;
26999 PyObject *py_srcfile = 0;
27000 PyObject *py_funcname = 0;
27001 #if PY_MAJOR_VERSION < 3
27002 py_srcfile = PyString_FromString(filename);
27004 py_srcfile = PyUnicode_FromString(filename);
27006 if (!py_srcfile)
goto bad;
27008 #if PY_MAJOR_VERSION < 3
27009 py_funcname = PyString_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
27011 py_funcname = PyUnicode_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
27015 #if PY_MAJOR_VERSION < 3
27016 py_funcname = PyString_FromString(funcname);
27018 py_funcname = PyUnicode_FromString(funcname);
27021 if (!py_funcname)
goto bad;
27022 py_code = __Pyx_PyCode_New(
27039 Py_DECREF(py_srcfile);
27040 Py_DECREF(py_funcname);
27043 Py_XDECREF(py_srcfile);
27044 Py_XDECREF(py_funcname);
27047 static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
27048 int py_line,
const char *filename) {
27049 PyCodeObject *py_code = 0;
27050 PyFrameObject *py_frame = 0;
27051 PyThreadState *tstate = __Pyx_PyThreadState_Current;
27053 c_line = __Pyx_CLineForTraceback(tstate, c_line);
27055 py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
27057 py_code = __Pyx_CreateCodeObjectForTraceback(
27058 funcname, c_line, py_line, filename);
27059 if (!py_code)
goto bad;
27060 __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
27062 py_frame = PyFrame_New(
27068 if (!py_frame)
goto bad;
27069 __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
27070 PyTraceBack_Here(py_frame);
27072 Py_XDECREF(py_code);
27073 Py_XDECREF(py_frame);
27076 #if PY_MAJOR_VERSION < 3
27077 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view,
int flags) {
27078 if (PyObject_CheckBuffer(obj))
return PyObject_GetBuffer(obj, view, flags);
27079 if (__Pyx_TypeCheck(obj, __pyx_array_type))
return __pyx_array_getbuffer(obj, view, flags);
27080 if (__Pyx_TypeCheck(obj, __pyx_memoryview_type))
return __pyx_memoryview_getbuffer(obj, view, flags);
27081 PyErr_Format(PyExc_TypeError,
"'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
27084 static void __Pyx_ReleaseBuffer(Py_buffer *view) {
27085 PyObject *obj = view->obj;
27087 if (PyObject_CheckBuffer(obj)) {
27088 PyBuffer_Release(view);
27100 __pyx_memviewslice_is_contig(
const __Pyx_memviewslice mvs,
char order,
int ndim)
27102 int i, index, step, start;
27103 Py_ssize_t itemsize = mvs.memview->view.itemsize;
27104 if (order ==
'F') {
27111 for (i = 0; i < ndim; i++) {
27112 index = start + step * i;
27113 if (mvs.suboffsets[index] >= 0 || mvs.strides[index] != itemsize)
27115 itemsize *= mvs.shape[index];
27122 __pyx_get_array_memory_extents(__Pyx_memviewslice *slice,
27123 void **out_start,
void **out_end,
27124 int ndim,
size_t itemsize)
27128 start = end = slice->data;
27129 for (i = 0; i < ndim; i++) {
27130 Py_ssize_t stride = slice->strides[i];
27131 Py_ssize_t extent = slice->shape[i];
27133 *out_start = *out_end = start;
27137 end += stride * (extent - 1);
27139 start += stride * (extent - 1);
27142 *out_start = start;
27143 *out_end = end + itemsize;
27146 __pyx_slices_overlap(__Pyx_memviewslice *slice1,
27147 __Pyx_memviewslice *slice2,
27148 int ndim,
size_t itemsize)
27150 void *start1, *end1, *start2, *end2;
27151 __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize);
27152 __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize);
27153 return (start1 < end2) && (start2 < end1);
27157 static CYTHON_INLINE PyObject *
27158 __pyx_capsule_create(
void *p, CYTHON_UNUSED
const char *sig)
27161 #if PY_VERSION_HEX >= 0x02070000
27162 cobj = PyCapsule_New(p, sig, NULL);
27164 cobj = PyCObject_FromVoidPtr(p, NULL);
27170 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
27171 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
27172 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
27173 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
27174 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
27176 func_type value = func_value;\
27177 if (sizeof(target_type) < sizeof(func_type)) {\
27178 if (unlikely(value != (func_type) (target_type) value)) {\
27179 func_type zero = 0;\
27180 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
27181 return (target_type) -1;\
27182 if (is_unsigned && unlikely(value < zero))\
27183 goto raise_neg_overflow;\
27185 goto raise_overflow;\
27188 return (target_type) value;\
27192 #if CYTHON_CCOMPLEX
27194 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
27195 return ::std::complex< float >(x, y);
27198 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
27199 return x + y*(__pyx_t_float_complex)_Complex_I;
27203 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
27204 __pyx_t_float_complex
z;
27212 #if CYTHON_CCOMPLEX
27214 static CYTHON_INLINE
int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27215 return (a.real == b.real) && (a.imag == b.imag);
27217 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27218 __pyx_t_float_complex
z;
27219 z.real = a.real + b.real;
27220 z.imag = a.imag + b.imag;
27223 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27224 __pyx_t_float_complex
z;
27225 z.real = a.real - b.real;
27226 z.imag = a.imag - b.imag;
27229 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27230 __pyx_t_float_complex
z;
27231 z.real = a.real * b.real - a.imag * b.imag;
27232 z.imag = a.real * b.imag + a.imag * b.real;
27236 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27238 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
27239 }
else if (fabsf(b.real) >= fabsf(b.imag)) {
27240 if (b.real == 0 && b.imag == 0) {
27241 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
27243 float r = b.imag / b.real;
27244 float s = (float)(1.0) / (b.real + b.imag *
r);
27245 return __pyx_t_float_complex_from_parts(
27246 (a.real + a.imag *
r) *
s, (a.imag - a.real *
r) *
s);
27249 float r = b.real / b.imag;
27250 float s = (float)(1.0) / (b.imag + b.real *
r);
27251 return __pyx_t_float_complex_from_parts(
27252 (a.real *
r + a.imag) *
s, (a.imag *
r - a.real) *
s);
27256 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27258 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
27260 float denom = b.real * b.real + b.imag * b.imag;
27261 return __pyx_t_float_complex_from_parts(
27262 (a.real * b.real + a.imag * b.imag) / denom,
27263 (a.imag * b.real - a.real * b.imag) / denom);
27267 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
27268 __pyx_t_float_complex
z;
27273 static CYTHON_INLINE
int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
27274 return (a.real == 0) && (a.imag == 0);
27276 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
27277 __pyx_t_float_complex
z;
27283 static CYTHON_INLINE
float __Pyx_c_abs_float(__pyx_t_float_complex
z) {
27284 #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
27285 return sqrtf(
z.real*
z.real +
z.imag*
z.imag);
27287 return hypotf(
z.real,
z.imag);
27290 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27291 __pyx_t_float_complex
z;
27292 float r, lnr, theta, z_r, z_theta;
27293 if (b.imag == 0 && b.real == (
int)b.real) {
27295 float denom = a.real * a.real + a.imag * a.imag;
27296 a.real = a.real / denom;
27297 a.imag = -a.imag / denom;
27300 switch ((
int)b.real) {
27308 return __Pyx_c_prod_float(a, a);
27310 z = __Pyx_c_prod_float(a, a);
27311 return __Pyx_c_prod_float(
z, a);
27313 z = __Pyx_c_prod_float(a, a);
27314 return __Pyx_c_prod_float(
z,
z);
27320 }
else if (b.imag == 0) {
27321 z.real = powf(a.real, b.real);
27324 }
else if (a.real > 0) {
27329 theta = atan2f(0.0, -1.0);
27332 r = __Pyx_c_abs_float(a);
27333 theta = atan2f(a.imag, a.real);
27336 z_r = expf(lnr * b.real - theta * b.imag);
27337 z_theta = theta * b.real + lnr * b.imag;
27338 z.real = z_r * cosf(z_theta);
27339 z.imag = z_r * sinf(z_theta);
27346 #if CYTHON_CCOMPLEX
27348 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
27349 return ::std::complex< double >(x, y);
27352 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
27353 return x + y*(__pyx_t_double_complex)_Complex_I;
27357 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
27358 __pyx_t_double_complex
z;
27366 #if CYTHON_CCOMPLEX
27368 static CYTHON_INLINE
int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27369 return (a.real == b.real) && (a.imag == b.imag);
27371 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27372 __pyx_t_double_complex
z;
27373 z.real = a.real + b.real;
27374 z.imag = a.imag + b.imag;
27377 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27378 __pyx_t_double_complex
z;
27379 z.real = a.real - b.real;
27380 z.imag = a.imag - b.imag;
27383 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27384 __pyx_t_double_complex
z;
27385 z.real = a.real * b.real - a.imag * b.imag;
27386 z.imag = a.real * b.imag + a.imag * b.real;
27390 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27392 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
27393 }
else if (fabs(b.real) >= fabs(b.imag)) {
27394 if (b.real == 0 && b.imag == 0) {
27395 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
27397 double r = b.imag / b.real;
27398 double s = (double)(1.0) / (b.real + b.imag *
r);
27399 return __pyx_t_double_complex_from_parts(
27400 (a.real + a.imag *
r) *
s, (a.imag - a.real *
r) *
s);
27403 double r = b.real / b.imag;
27404 double s = (double)(1.0) / (b.imag + b.real *
r);
27405 return __pyx_t_double_complex_from_parts(
27406 (a.real *
r + a.imag) *
s, (a.imag *
r - a.real) *
s);
27410 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27412 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
27414 double denom = b.real * b.real + b.imag * b.imag;
27415 return __pyx_t_double_complex_from_parts(
27416 (a.real * b.real + a.imag * b.imag) / denom,
27417 (a.imag * b.real - a.real * b.imag) / denom);
27421 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
27422 __pyx_t_double_complex
z;
27427 static CYTHON_INLINE
int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
27428 return (a.real == 0) && (a.imag == 0);
27430 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
27431 __pyx_t_double_complex
z;
27437 static CYTHON_INLINE
double __Pyx_c_abs_double(__pyx_t_double_complex
z) {
27438 #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
27439 return sqrt(
z.real*
z.real +
z.imag*
z.imag);
27441 return hypot(
z.real,
z.imag);
27444 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27445 __pyx_t_double_complex
z;
27446 double r, lnr, theta, z_r, z_theta;
27447 if (b.imag == 0 && b.real == (
int)b.real) {
27449 double denom = a.real * a.real + a.imag * a.imag;
27450 a.real = a.real / denom;
27451 a.imag = -a.imag / denom;
27454 switch ((
int)b.real) {
27462 return __Pyx_c_prod_double(a, a);
27464 z = __Pyx_c_prod_double(a, a);
27465 return __Pyx_c_prod_double(
z, a);
27467 z = __Pyx_c_prod_double(a, a);
27468 return __Pyx_c_prod_double(
z,
z);
27474 }
else if (b.imag == 0) {
27475 z.real = pow(a.real, b.real);
27478 }
else if (a.real > 0) {
27483 theta = atan2(0.0, -1.0);
27486 r = __Pyx_c_abs_double(a);
27487 theta = atan2(a.imag, a.real);
27490 z_r = exp(lnr * b.real - theta * b.imag);
27491 z_theta = theta * b.real + lnr * b.imag;
27492 z.real = z_r * cos(z_theta);
27493 z.imag = z_r * sin(z_theta);
27500 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(
int value) {
27501 const int neg_one = (int) ((
int) 0 - (int) 1), const_zero = (int) 0;
27502 const int is_unsigned = neg_one > const_zero;
27504 if (
sizeof(
int) <
sizeof(long)) {
27505 return PyInt_FromLong((
long) value);
27506 }
else if (
sizeof(
int) <=
sizeof(
unsigned long)) {
27507 return PyLong_FromUnsignedLong((
unsigned long) value);
27508 #ifdef HAVE_LONG_LONG
27509 }
else if (
sizeof(
int) <=
sizeof(
unsigned PY_LONG_LONG)) {
27510 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
27514 if (
sizeof(
int) <=
sizeof(
long)) {
27515 return PyInt_FromLong((
long) value);
27516 #ifdef HAVE_LONG_LONG
27517 }
else if (
sizeof(
int) <=
sizeof(PY_LONG_LONG)) {
27518 return PyLong_FromLongLong((PY_LONG_LONG) value);
27523 int one = 1;
int little = (int)*(
unsigned char *)&one;
27524 unsigned char *bytes = (
unsigned char *)&value;
27525 return _PyLong_FromByteArray(bytes,
sizeof(
int),
27526 little, !is_unsigned);
27531 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(
enum NPY_TYPES value) {
27532 const enum NPY_TYPES neg_one = (
enum NPY_TYPES) ((
enum NPY_TYPES) 0 - (
enum NPY_TYPES) 1), const_zero = (
enum NPY_TYPES) 0;
27533 const int is_unsigned = neg_one > const_zero;
27535 if (
sizeof(
enum NPY_TYPES) <
sizeof(long)) {
27536 return PyInt_FromLong((
long) value);
27537 }
else if (
sizeof(
enum NPY_TYPES) <=
sizeof(
unsigned long)) {
27538 return PyLong_FromUnsignedLong((
unsigned long) value);
27539 #ifdef HAVE_LONG_LONG
27540 }
else if (
sizeof(
enum NPY_TYPES) <=
sizeof(
unsigned PY_LONG_LONG)) {
27541 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
27545 if (
sizeof(
enum NPY_TYPES) <=
sizeof(
long)) {
27546 return PyInt_FromLong((
long) value);
27547 #ifdef HAVE_LONG_LONG
27548 }
else if (
sizeof(
enum NPY_TYPES) <=
sizeof(PY_LONG_LONG)) {
27549 return PyLong_FromLongLong((PY_LONG_LONG) value);
27554 int one = 1;
int little = (int)*(
unsigned char *)&one;
27555 unsigned char *bytes = (
unsigned char *)&value;
27556 return _PyLong_FromByteArray(bytes,
sizeof(
enum NPY_TYPES),
27557 little, !is_unsigned);
27562 static __Pyx_memviewslice
27563 __pyx_memoryview_copy_new_contig(
const __Pyx_memviewslice *from_mvs,
27564 const char *mode,
int ndim,
27565 size_t sizeof_dtype,
int contig_flag,
27566 int dtype_is_object)
27568 __Pyx_RefNannyDeclarations
27570 __Pyx_memviewslice new_mvs = { 0, 0, { 0 }, { 0 }, { 0 } };
27571 struct __pyx_memoryview_obj *from_memview = from_mvs->memview;
27572 Py_buffer *buf = &from_memview->view;
27573 PyObject *shape_tuple = NULL;
27574 PyObject *temp_int = NULL;
27575 struct __pyx_array_obj *array_obj = NULL;
27576 struct __pyx_memoryview_obj *memview_obj = NULL;
27577 __Pyx_RefNannySetupContext(
"__pyx_memoryview_copy_new_contig", 0);
27578 for (i = 0; i < ndim; i++) {
27579 if (unlikely(from_mvs->suboffsets[i] >= 0)) {
27580 PyErr_Format(PyExc_ValueError,
"Cannot copy memoryview slice with "
27581 "indirect dimensions (axis %d)", i);
27585 shape_tuple = PyTuple_New(ndim);
27586 if (unlikely(!shape_tuple)) {
27589 __Pyx_GOTREF(shape_tuple);
27590 for(i = 0; i < ndim; i++) {
27591 temp_int = PyInt_FromSsize_t(from_mvs->shape[i]);
27592 if(unlikely(!temp_int)) {
27595 PyTuple_SET_ITEM(shape_tuple, i, temp_int);
27599 array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, (
char *) mode, NULL);
27600 if (unlikely(!array_obj)) {
27603 __Pyx_GOTREF(array_obj);
27604 memview_obj = (
struct __pyx_memoryview_obj *) __pyx_memoryview_new(
27605 (PyObject *) array_obj, contig_flag,
27607 from_mvs->memview->typeinfo);
27608 if (unlikely(!memview_obj))
27610 if (unlikely(__Pyx_init_memviewslice(memview_obj, ndim, &new_mvs, 1) < 0))
27612 if (unlikely(__pyx_memoryview_copy_contents(*from_mvs, new_mvs, ndim, ndim,
27613 dtype_is_object) < 0))
27617 __Pyx_XDECREF(new_mvs.memview);
27618 new_mvs.memview = NULL;
27619 new_mvs.data = NULL;
27621 __Pyx_XDECREF(shape_tuple);
27622 __Pyx_XDECREF(temp_int);
27623 __Pyx_XDECREF(array_obj);
27624 __Pyx_RefNannyFinishContext();
27629 static CYTHON_INLINE
int __Pyx_PyInt_As_int(PyObject *x) {
27630 const int neg_one = (int) ((
int) 0 - (int) 1), const_zero = (int) 0;
27631 const int is_unsigned = neg_one > const_zero;
27632 #if PY_MAJOR_VERSION < 3
27633 if (likely(PyInt_Check(x))) {
27634 if (
sizeof(
int) <
sizeof(long)) {
27635 __PYX_VERIFY_RETURN_INT(
int,
long, PyInt_AS_LONG(x))
27637 long val = PyInt_AS_LONG(x);
27638 if (is_unsigned && unlikely(val < 0)) {
27639 goto raise_neg_overflow;
27645 if (likely(PyLong_Check(x))) {
27647 #if CYTHON_USE_PYLONG_INTERNALS
27648 const digit* digits = ((PyLongObject*)x)->ob_digit;
27649 switch (Py_SIZE(x)) {
27650 case 0:
return (
int) 0;
27651 case 1: __PYX_VERIFY_RETURN_INT(
int, digit, digits[0])
27653 if (8 *
sizeof(
int) > 1 * PyLong_SHIFT) {
27654 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
27655 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27656 }
else if (8 *
sizeof(
int) >= 2 * PyLong_SHIFT) {
27657 return (
int) (((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0]));
27662 if (8 *
sizeof(
int) > 2 * PyLong_SHIFT) {
27663 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
27664 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27665 }
else if (8 *
sizeof(
int) >= 3 * PyLong_SHIFT) {
27666 return (
int) (((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
27671 if (8 *
sizeof(
int) > 3 * PyLong_SHIFT) {
27672 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
27673 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27674 }
else if (8 *
sizeof(
int) >= 4 * PyLong_SHIFT) {
27675 return (
int) (((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0]));
27681 #if CYTHON_COMPILING_IN_CPYTHON
27682 if (unlikely(Py_SIZE(x) < 0)) {
27683 goto raise_neg_overflow;
27687 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
27688 if (unlikely(result < 0))
27690 if (unlikely(result == 1))
27691 goto raise_neg_overflow;
27694 if (
sizeof(
int) <=
sizeof(
unsigned long)) {
27695 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned long, PyLong_AsUnsignedLong(x))
27696 #ifdef HAVE_LONG_LONG
27697 }
else if (
sizeof(
int) <=
sizeof(
unsigned PY_LONG_LONG)) {
27698 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
27702 #if CYTHON_USE_PYLONG_INTERNALS
27703 const digit* digits = ((PyLongObject*)x)->ob_digit;
27704 switch (Py_SIZE(x)) {
27705 case 0:
return (
int) 0;
27706 case -1: __PYX_VERIFY_RETURN_INT(
int, sdigit, (sdigit) (-(sdigit)digits[0]))
27707 case 1: __PYX_VERIFY_RETURN_INT(
int, digit, +digits[0])
27709 if (8 *
sizeof(
int) - 1 > 1 * PyLong_SHIFT) {
27710 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
27711 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27712 }
else if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
27713 return (
int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
27718 if (8 *
sizeof(
int) > 1 * PyLong_SHIFT) {
27719 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
27720 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27721 }
else if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
27722 return (
int) ((((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
27727 if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
27728 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
27729 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27730 }
else if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
27731 return (
int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
27736 if (8 *
sizeof(
int) > 2 * PyLong_SHIFT) {
27737 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
27738 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27739 }
else if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
27740 return (
int) ((((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
27745 if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
27746 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
27747 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27748 }
else if (8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT) {
27749 return (
int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
27754 if (8 *
sizeof(
int) > 3 * PyLong_SHIFT) {
27755 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
27756 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27757 }
else if (8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT) {
27758 return (
int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
27764 if (
sizeof(
int) <=
sizeof(long)) {
27765 __PYX_VERIFY_RETURN_INT_EXC(
int,
long, PyLong_AsLong(x))
27766 #ifdef HAVE_LONG_LONG
27767 }
else if (
sizeof(
int) <=
sizeof(PY_LONG_LONG)) {
27768 __PYX_VERIFY_RETURN_INT_EXC(
int, PY_LONG_LONG, PyLong_AsLongLong(x))
27773 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
27774 PyErr_SetString(PyExc_RuntimeError,
27775 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
27778 PyObject *
v = __Pyx_PyNumber_IntOrLong(x);
27779 #if PY_MAJOR_VERSION < 3
27780 if (likely(
v) && !PyLong_Check(
v)) {
27782 v = PyNumber_Long(tmp);
27787 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
27788 unsigned char *bytes = (
unsigned char *)&val;
27789 int ret = _PyLong_AsByteArray((PyLongObject *)
v,
27790 bytes,
sizeof(val),
27791 is_little, !is_unsigned);
27801 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
27802 if (!tmp)
return (
int) -1;
27803 val = __Pyx_PyInt_As_int(tmp);
27808 PyErr_SetString(PyExc_OverflowError,
27809 "value too large to convert to int");
27811 raise_neg_overflow:
27812 PyErr_SetString(PyExc_OverflowError,
27813 "can't convert negative value to int");
27818 static CYTHON_INLINE
long __Pyx_PyInt_As_long(PyObject *x) {
27819 const long neg_one = (long) ((
long) 0 - (long) 1), const_zero = (long) 0;
27820 const int is_unsigned = neg_one > const_zero;
27821 #if PY_MAJOR_VERSION < 3
27822 if (likely(PyInt_Check(x))) {
27823 if (
sizeof(
long) <
sizeof(long)) {
27824 __PYX_VERIFY_RETURN_INT(
long,
long, PyInt_AS_LONG(x))
27826 long val = PyInt_AS_LONG(x);
27827 if (is_unsigned && unlikely(val < 0)) {
27828 goto raise_neg_overflow;
27834 if (likely(PyLong_Check(x))) {
27836 #if CYTHON_USE_PYLONG_INTERNALS
27837 const digit* digits = ((PyLongObject*)x)->ob_digit;
27838 switch (Py_SIZE(x)) {
27839 case 0:
return (
long) 0;
27840 case 1: __PYX_VERIFY_RETURN_INT(
long, digit, digits[0])
27842 if (8 *
sizeof(
long) > 1 * PyLong_SHIFT) {
27843 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
27844 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27845 }
else if (8 *
sizeof(
long) >= 2 * PyLong_SHIFT) {
27846 return (
long) (((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0]));
27851 if (8 *
sizeof(
long) > 2 * PyLong_SHIFT) {
27852 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
27853 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27854 }
else if (8 *
sizeof(
long) >= 3 * PyLong_SHIFT) {
27855 return (
long) (((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
27860 if (8 *
sizeof(
long) > 3 * PyLong_SHIFT) {
27861 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
27862 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27863 }
else if (8 *
sizeof(
long) >= 4 * PyLong_SHIFT) {
27864 return (
long) (((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0]));
27870 #if CYTHON_COMPILING_IN_CPYTHON
27871 if (unlikely(Py_SIZE(x) < 0)) {
27872 goto raise_neg_overflow;
27876 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
27877 if (unlikely(result < 0))
27879 if (unlikely(result == 1))
27880 goto raise_neg_overflow;
27883 if (
sizeof(
long) <=
sizeof(
unsigned long)) {
27884 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned long, PyLong_AsUnsignedLong(x))
27885 #ifdef HAVE_LONG_LONG
27886 }
else if (
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG)) {
27887 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
27891 #if CYTHON_USE_PYLONG_INTERNALS
27892 const digit* digits = ((PyLongObject*)x)->ob_digit;
27893 switch (Py_SIZE(x)) {
27894 case 0:
return (
long) 0;
27895 case -1: __PYX_VERIFY_RETURN_INT(
long, sdigit, (sdigit) (-(sdigit)digits[0]))
27896 case 1: __PYX_VERIFY_RETURN_INT(
long, digit, +digits[0])
27898 if (8 *
sizeof(
long) - 1 > 1 * PyLong_SHIFT) {
27899 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
27900 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27901 }
else if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
27902 return (
long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
27907 if (8 *
sizeof(
long) > 1 * PyLong_SHIFT) {
27908 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
27909 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27910 }
else if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
27911 return (
long) ((((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
27916 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
27917 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
27918 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27919 }
else if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
27920 return (
long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
27925 if (8 *
sizeof(
long) > 2 * PyLong_SHIFT) {
27926 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
27927 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27928 }
else if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
27929 return (
long) ((((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
27934 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
27935 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
27936 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27937 }
else if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
27938 return (
long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
27943 if (8 *
sizeof(
long) > 3 * PyLong_SHIFT) {
27944 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
27945 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27946 }
else if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
27947 return (
long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
27953 if (
sizeof(
long) <=
sizeof(long)) {
27954 __PYX_VERIFY_RETURN_INT_EXC(
long,
long, PyLong_AsLong(x))
27955 #ifdef HAVE_LONG_LONG
27956 }
else if (
sizeof(
long) <=
sizeof(PY_LONG_LONG)) {
27957 __PYX_VERIFY_RETURN_INT_EXC(
long, PY_LONG_LONG, PyLong_AsLongLong(x))
27962 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
27963 PyErr_SetString(PyExc_RuntimeError,
27964 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
27967 PyObject *
v = __Pyx_PyNumber_IntOrLong(x);
27968 #if PY_MAJOR_VERSION < 3
27969 if (likely(
v) && !PyLong_Check(
v)) {
27971 v = PyNumber_Long(tmp);
27976 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
27977 unsigned char *bytes = (
unsigned char *)&val;
27978 int ret = _PyLong_AsByteArray((PyLongObject *)
v,
27979 bytes,
sizeof(val),
27980 is_little, !is_unsigned);
27990 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
27991 if (!tmp)
return (
long) -1;
27992 val = __Pyx_PyInt_As_long(tmp);
27997 PyErr_SetString(PyExc_OverflowError,
27998 "value too large to convert to long");
28000 raise_neg_overflow:
28001 PyErr_SetString(PyExc_OverflowError,
28002 "can't convert negative value to long");
28007 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(
long value) {
28008 const long neg_one = (long) ((
long) 0 - (long) 1), const_zero = (long) 0;
28009 const int is_unsigned = neg_one > const_zero;
28011 if (
sizeof(
long) <
sizeof(long)) {
28012 return PyInt_FromLong((
long) value);
28013 }
else if (
sizeof(
long) <=
sizeof(
unsigned long)) {
28014 return PyLong_FromUnsignedLong((
unsigned long) value);
28015 #ifdef HAVE_LONG_LONG
28016 }
else if (
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG)) {
28017 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
28021 if (
sizeof(
long) <=
sizeof(
long)) {
28022 return PyInt_FromLong((
long) value);
28023 #ifdef HAVE_LONG_LONG
28024 }
else if (
sizeof(
long) <=
sizeof(PY_LONG_LONG)) {
28025 return PyLong_FromLongLong((PY_LONG_LONG) value);
28030 int one = 1;
int little = (int)*(
unsigned char *)&one;
28031 unsigned char *bytes = (
unsigned char *)&value;
28032 return _PyLong_FromByteArray(bytes,
sizeof(
long),
28033 little, !is_unsigned);
28038 static CYTHON_INLINE
char __Pyx_PyInt_As_char(PyObject *x) {
28039 const char neg_one = (char) ((
char) 0 - (char) 1), const_zero = (char) 0;
28040 const int is_unsigned = neg_one > const_zero;
28041 #if PY_MAJOR_VERSION < 3
28042 if (likely(PyInt_Check(x))) {
28043 if (
sizeof(
char) <
sizeof(long)) {
28044 __PYX_VERIFY_RETURN_INT(
char,
long, PyInt_AS_LONG(x))
28046 long val = PyInt_AS_LONG(x);
28047 if (is_unsigned && unlikely(val < 0)) {
28048 goto raise_neg_overflow;
28054 if (likely(PyLong_Check(x))) {
28056 #if CYTHON_USE_PYLONG_INTERNALS
28057 const digit* digits = ((PyLongObject*)x)->ob_digit;
28058 switch (Py_SIZE(x)) {
28059 case 0:
return (
char) 0;
28060 case 1: __PYX_VERIFY_RETURN_INT(
char, digit, digits[0])
28062 if (8 *
sizeof(
char) > 1 * PyLong_SHIFT) {
28063 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
28064 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28065 }
else if (8 *
sizeof(
char) >= 2 * PyLong_SHIFT) {
28066 return (
char) (((((char)digits[1]) << PyLong_SHIFT) | (
char)digits[0]));
28071 if (8 *
sizeof(
char) > 2 * PyLong_SHIFT) {
28072 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
28073 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28074 }
else if (8 *
sizeof(
char) >= 3 * PyLong_SHIFT) {
28075 return (
char) (((((((char)digits[2]) << PyLong_SHIFT) | (
char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
28080 if (8 *
sizeof(
char) > 3 * PyLong_SHIFT) {
28081 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
28082 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28083 }
else if (8 *
sizeof(
char) >= 4 * PyLong_SHIFT) {
28084 return (
char) (((((((((char)digits[3]) << PyLong_SHIFT) | (
char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (
char)digits[0]));
28090 #if CYTHON_COMPILING_IN_CPYTHON
28091 if (unlikely(Py_SIZE(x) < 0)) {
28092 goto raise_neg_overflow;
28096 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
28097 if (unlikely(result < 0))
28099 if (unlikely(result == 1))
28100 goto raise_neg_overflow;
28103 if (
sizeof(
char) <=
sizeof(
unsigned long)) {
28104 __PYX_VERIFY_RETURN_INT_EXC(
char,
unsigned long, PyLong_AsUnsignedLong(x))
28105 #ifdef HAVE_LONG_LONG
28106 }
else if (
sizeof(
char) <=
sizeof(
unsigned PY_LONG_LONG)) {
28107 __PYX_VERIFY_RETURN_INT_EXC(
char,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
28111 #if CYTHON_USE_PYLONG_INTERNALS
28112 const digit* digits = ((PyLongObject*)x)->ob_digit;
28113 switch (Py_SIZE(x)) {
28114 case 0:
return (
char) 0;
28115 case -1: __PYX_VERIFY_RETURN_INT(
char, sdigit, (sdigit) (-(sdigit)digits[0]))
28116 case 1: __PYX_VERIFY_RETURN_INT(
char, digit, +digits[0])
28118 if (8 *
sizeof(
char) - 1 > 1 * PyLong_SHIFT) {
28119 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
28120 __PYX_VERIFY_RETURN_INT(
char,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28121 }
else if (8 *
sizeof(
char) - 1 > 2 * PyLong_SHIFT) {
28122 return (
char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (
char)digits[0])));
28127 if (8 *
sizeof(
char) > 1 * PyLong_SHIFT) {
28128 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
28129 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28130 }
else if (8 *
sizeof(
char) - 1 > 2 * PyLong_SHIFT) {
28131 return (
char) ((((((char)digits[1]) << PyLong_SHIFT) | (
char)digits[0])));
28136 if (8 *
sizeof(
char) - 1 > 2 * PyLong_SHIFT) {
28137 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
28138 __PYX_VERIFY_RETURN_INT(
char,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28139 }
else if (8 *
sizeof(
char) - 1 > 3 * PyLong_SHIFT) {
28140 return (
char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (
char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
28145 if (8 *
sizeof(
char) > 2 * PyLong_SHIFT) {
28146 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
28147 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28148 }
else if (8 *
sizeof(
char) - 1 > 3 * PyLong_SHIFT) {
28149 return (
char) ((((((((char)digits[2]) << PyLong_SHIFT) | (
char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
28154 if (8 *
sizeof(
char) - 1 > 3 * PyLong_SHIFT) {
28155 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
28156 __PYX_VERIFY_RETURN_INT(
char,
long, -(
long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28157 }
else if (8 *
sizeof(
char) - 1 > 4 * PyLong_SHIFT) {
28158 return (
char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (
char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (
char)digits[0])));
28163 if (8 *
sizeof(
char) > 3 * PyLong_SHIFT) {
28164 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
28165 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28166 }
else if (8 *
sizeof(
char) - 1 > 4 * PyLong_SHIFT) {
28167 return (
char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (
char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (
char)digits[0])));
28173 if (
sizeof(
char) <=
sizeof(long)) {
28174 __PYX_VERIFY_RETURN_INT_EXC(
char,
long, PyLong_AsLong(x))
28175 #ifdef HAVE_LONG_LONG
28176 }
else if (
sizeof(
char) <=
sizeof(PY_LONG_LONG)) {
28177 __PYX_VERIFY_RETURN_INT_EXC(
char, PY_LONG_LONG, PyLong_AsLongLong(x))
28182 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
28183 PyErr_SetString(PyExc_RuntimeError,
28184 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
28187 PyObject *
v = __Pyx_PyNumber_IntOrLong(x);
28188 #if PY_MAJOR_VERSION < 3
28189 if (likely(
v) && !PyLong_Check(
v)) {
28191 v = PyNumber_Long(tmp);
28196 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
28197 unsigned char *bytes = (
unsigned char *)&val;
28198 int ret = _PyLong_AsByteArray((PyLongObject *)
v,
28199 bytes,
sizeof(val),
28200 is_little, !is_unsigned);
28210 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
28211 if (!tmp)
return (
char) -1;
28212 val = __Pyx_PyInt_As_char(tmp);
28217 PyErr_SetString(PyExc_OverflowError,
28218 "value too large to convert to char");
28220 raise_neg_overflow:
28221 PyErr_SetString(PyExc_OverflowError,
28222 "can't convert negative value to char");
28227 static CYTHON_INLINE
int __Pyx_Is_Little_Endian(
void)
28233 S.u32 = 0x01020304;
28234 return S.u8[0] == 4;
28238 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
28239 __Pyx_BufFmt_StackElem* stack,
28240 __Pyx_TypeInfo* type) {
28241 stack[0].field = &ctx->root;
28242 stack[0].parent_offset = 0;
28243 ctx->root.type = type;
28244 ctx->root.name =
"buffer dtype";
28245 ctx->root.offset = 0;
28247 ctx->head->field = &ctx->root;
28248 ctx->fmt_offset = 0;
28249 ctx->head->parent_offset = 0;
28250 ctx->new_packmode =
'@';
28251 ctx->enc_packmode =
'@';
28252 ctx->new_count = 1;
28253 ctx->enc_count = 0;
28255 ctx->is_complex = 0;
28256 ctx->is_valid_array = 0;
28257 ctx->struct_alignment = 0;
28258 while (type->typegroup ==
'S') {
28260 ctx->head->field = type->fields;
28261 ctx->head->parent_offset = 0;
28262 type = type->fields->type;
28265 static int __Pyx_BufFmt_ParseNumber(
const char** ts) {
28267 const char* t = *ts;
28268 if (*t < '0' || *t >
'9') {
28271 count = *t++ -
'0';
28272 while (*t >=
'0' && *t <=
'9') {
28274 count += *t++ -
'0';
28280 static int __Pyx_BufFmt_ExpectNumber(
const char **ts) {
28281 int number = __Pyx_BufFmt_ParseNumber(ts);
28283 PyErr_Format(PyExc_ValueError,\
28284 "Does not understand character buffer dtype format string ('%c')", **ts);
28287 static void __Pyx_BufFmt_RaiseUnexpectedChar(
char ch) {
28288 PyErr_Format(PyExc_ValueError,
28289 "Unexpected format string character: '%c'", ch);
28291 static const char* __Pyx_BufFmt_DescribeTypeChar(
char ch,
int is_complex) {
28293 case '?':
return "'bool'";
28294 case 'c':
return "'char'";
28295 case 'b':
return "'signed char'";
28296 case 'B':
return "'unsigned char'";
28297 case 'h':
return "'short'";
28298 case 'H':
return "'unsigned short'";
28299 case 'i':
return "'int'";
28300 case 'I':
return "'unsigned int'";
28301 case 'l':
return "'long'";
28302 case 'L':
return "'unsigned long'";
28303 case 'q':
return "'long long'";
28304 case 'Q':
return "'unsigned long long'";
28305 case 'f':
return (is_complex ?
"'complex float'" :
"'float'");
28306 case 'd':
return (is_complex ?
"'complex double'" :
"'double'");
28307 case 'g':
return (is_complex ?
"'complex long double'" :
"'long double'");
28308 case 'T':
return "a struct";
28309 case 'O':
return "Python object";
28310 case 'P':
return "a pointer";
28311 case 's':
case 'p':
return "a string";
28312 case 0:
return "end";
28313 default:
return "unparseable format string";
28316 static size_t __Pyx_BufFmt_TypeCharToStandardSize(
char ch,
int is_complex) {
28318 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
28319 case 'h':
case 'H':
return 2;
28320 case 'i':
case 'I':
case 'l':
case 'L':
return 4;
28321 case 'q':
case 'Q':
return 8;
28322 case 'f':
return (is_complex ? 8 : 4);
28323 case 'd':
return (is_complex ? 16 : 8);
28325 PyErr_SetString(PyExc_ValueError,
"Python does not define a standard format string size for long double ('g')..");
28328 case 'O':
case 'P':
return sizeof(
void*);
28330 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
28334 static size_t __Pyx_BufFmt_TypeCharToNativeSize(
char ch,
int is_complex) {
28336 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
28337 case 'h':
case 'H':
return sizeof(short);
28338 case 'i':
case 'I':
return sizeof(int);
28339 case 'l':
case 'L':
return sizeof(long);
28340 #ifdef HAVE_LONG_LONG
28341 case 'q':
case 'Q':
return sizeof(PY_LONG_LONG);
28343 case 'f':
return sizeof(float) * (is_complex ? 2 : 1);
28344 case 'd':
return sizeof(double) * (is_complex ? 2 : 1);
28345 case 'g':
return sizeof(
long double) * (is_complex ? 2 : 1);
28346 case 'O':
case 'P':
return sizeof(
void*);
28348 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
28353 typedef struct {
char c;
short x; } __Pyx_st_short;
28354 typedef struct {
char c;
int x; } __Pyx_st_int;
28355 typedef struct {
char c;
long x; } __Pyx_st_long;
28356 typedef struct {
char c;
float x; } __Pyx_st_float;
28357 typedef struct {
char c;
double x; } __Pyx_st_double;
28358 typedef struct {
char c;
long double x; } __Pyx_st_longdouble;
28359 typedef struct {
char c;
void *x; } __Pyx_st_void_p;
28360 #ifdef HAVE_LONG_LONG
28361 typedef struct {
char c; PY_LONG_LONG x; } __Pyx_st_longlong;
28363 static size_t __Pyx_BufFmt_TypeCharToAlignment(
char ch, CYTHON_UNUSED
int is_complex) {
28365 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
28366 case 'h':
case 'H':
return sizeof(__Pyx_st_short) -
sizeof(
short);
28367 case 'i':
case 'I':
return sizeof(__Pyx_st_int) -
sizeof(
int);
28368 case 'l':
case 'L':
return sizeof(__Pyx_st_long) -
sizeof(
long);
28369 #ifdef HAVE_LONG_LONG
28370 case 'q':
case 'Q':
return sizeof(__Pyx_st_longlong) -
sizeof(PY_LONG_LONG);
28372 case 'f':
return sizeof(__Pyx_st_float) -
sizeof(
float);
28373 case 'd':
return sizeof(__Pyx_st_double) -
sizeof(
double);
28374 case 'g':
return sizeof(__Pyx_st_longdouble) -
sizeof(
long double);
28375 case 'P':
case 'O':
return sizeof(__Pyx_st_void_p) -
sizeof(
void*);
28377 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
28385 typedef struct {
short x;
char c; } __Pyx_pad_short;
28386 typedef struct {
int x;
char c; } __Pyx_pad_int;
28387 typedef struct {
long x;
char c; } __Pyx_pad_long;
28388 typedef struct {
float x;
char c; } __Pyx_pad_float;
28389 typedef struct {
double x;
char c; } __Pyx_pad_double;
28390 typedef struct {
long double x;
char c; } __Pyx_pad_longdouble;
28391 typedef struct {
void *x;
char c; } __Pyx_pad_void_p;
28392 #ifdef HAVE_LONG_LONG
28393 typedef struct { PY_LONG_LONG x;
char c; } __Pyx_pad_longlong;
28395 static size_t __Pyx_BufFmt_TypeCharToPadding(
char ch, CYTHON_UNUSED
int is_complex) {
28397 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
28398 case 'h':
case 'H':
return sizeof(__Pyx_pad_short) -
sizeof(
short);
28399 case 'i':
case 'I':
return sizeof(__Pyx_pad_int) -
sizeof(
int);
28400 case 'l':
case 'L':
return sizeof(__Pyx_pad_long) -
sizeof(
long);
28401 #ifdef HAVE_LONG_LONG
28402 case 'q':
case 'Q':
return sizeof(__Pyx_pad_longlong) -
sizeof(PY_LONG_LONG);
28404 case 'f':
return sizeof(__Pyx_pad_float) -
sizeof(
float);
28405 case 'd':
return sizeof(__Pyx_pad_double) -
sizeof(
double);
28406 case 'g':
return sizeof(__Pyx_pad_longdouble) -
sizeof(
long double);
28407 case 'P':
case 'O':
return sizeof(__Pyx_pad_void_p) -
sizeof(
void*);
28409 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
28413 static char __Pyx_BufFmt_TypeCharToGroup(
char ch,
int is_complex) {
28417 case 'b':
case 'h':
case 'i':
28418 case 'l':
case 'q':
case 's':
case 'p':
28420 case '?':
case 'B':
case 'H':
case 'I':
case 'L':
case 'Q':
28422 case 'f':
case 'd':
case 'g':
28423 return (is_complex ?
'C' :
'R');
28429 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
28434 static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
28435 if (ctx->head == NULL || ctx->head->field == &ctx->root) {
28436 const char* expected;
28438 if (ctx->head == NULL) {
28442 expected = ctx->head->field->type->name;
28445 PyErr_Format(PyExc_ValueError,
28446 "Buffer dtype mismatch, expected %s%s%s but got %s",
28447 quote, expected, quote,
28448 __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
28450 __Pyx_StructField* field = ctx->head->field;
28451 __Pyx_StructField* parent = (ctx->head - 1)->field;
28452 PyErr_Format(PyExc_ValueError,
28453 "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
28454 field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
28455 parent->type->name, field->name);
28458 static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
28460 size_t size, offset, arraysize = 1;
28461 if (ctx->enc_type == 0)
return 0;
28462 if (ctx->head->field->type->arraysize[0]) {
28464 if (ctx->enc_type ==
's' || ctx->enc_type ==
'p') {
28465 ctx->is_valid_array = ctx->head->field->type->ndim == 1;
28467 if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
28468 PyErr_Format(PyExc_ValueError,
28469 "Expected a dimension of size %zu, got %zu",
28470 ctx->head->field->type->arraysize[0], ctx->enc_count);
28474 if (!ctx->is_valid_array) {
28475 PyErr_Format(PyExc_ValueError,
"Expected %d dimensions, got %d",
28476 ctx->head->field->type->ndim, ndim);
28479 for (i = 0; i < ctx->head->field->type->ndim; i++) {
28480 arraysize *= ctx->head->field->type->arraysize[i];
28482 ctx->is_valid_array = 0;
28483 ctx->enc_count = 1;
28485 group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
28487 __Pyx_StructField* field = ctx->head->field;
28488 __Pyx_TypeInfo* type = field->type;
28489 if (ctx->enc_packmode ==
'@' || ctx->enc_packmode ==
'^') {
28490 size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
28492 size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
28494 if (ctx->enc_packmode ==
'@') {
28495 size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
28496 size_t align_mod_offset;
28497 if (align_at == 0)
return -1;
28498 align_mod_offset = ctx->fmt_offset % align_at;
28499 if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
28500 if (ctx->struct_alignment == 0)
28501 ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
28504 if (type->size != size || type->typegroup != group) {
28505 if (type->typegroup ==
'C' && type->fields != NULL) {
28506 size_t parent_offset = ctx->head->parent_offset + field->offset;
28508 ctx->head->field = type->fields;
28509 ctx->head->parent_offset = parent_offset;
28512 if ((type->typegroup ==
'H' || group ==
'H') && type->size == size) {
28514 __Pyx_BufFmt_RaiseExpected(ctx);
28518 offset = ctx->head->parent_offset + field->offset;
28519 if (ctx->fmt_offset != offset) {
28520 PyErr_Format(PyExc_ValueError,
28521 "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T
"d but %" CYTHON_FORMAT_SSIZE_T
"d expected",
28522 (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
28525 ctx->fmt_offset += size;
28527 ctx->fmt_offset += (arraysize - 1) * size;
28530 if (field == &ctx->root) {
28532 if (ctx->enc_count != 0) {
28533 __Pyx_BufFmt_RaiseExpected(ctx);
28538 ctx->head->field = ++field;
28539 if (field->type == NULL) {
28541 field = ctx->head->field;
28543 }
else if (field->type->typegroup ==
'S') {
28544 size_t parent_offset = ctx->head->parent_offset + field->offset;
28545 if (field->type->fields->type == NULL)
continue;
28546 field = field->type->fields;
28548 ctx->head->field = field;
28549 ctx->head->parent_offset = parent_offset;
28555 }
while (ctx->enc_count);
28557 ctx->is_complex = 0;
28561 __pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx,
const char** tsp)
28563 const char *ts = *tsp;
28564 int i = 0,
number, ndim;
28566 if (ctx->new_count != 1) {
28567 PyErr_SetString(PyExc_ValueError,
28568 "Cannot handle repeated arrays in format string");
28571 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
28572 ndim = ctx->head->field->type->ndim;
28573 while (*ts && *ts !=
')') {
28575 case ' ':
case '\f':
case '\r':
case '\n':
case '\t':
case '\v':
continue;
28578 number = __Pyx_BufFmt_ExpectNumber(&ts);
28579 if (
number == -1)
return NULL;
28580 if (i < ndim && (
size_t)
number != ctx->head->field->type->arraysize[i])
28581 return PyErr_Format(PyExc_ValueError,
28582 "Expected a dimension of size %zu, got %d",
28583 ctx->head->field->type->arraysize[i],
number);
28584 if (*ts !=
',' && *ts !=
')')
28585 return PyErr_Format(PyExc_ValueError,
28586 "Expected a comma in format string, got '%c'", *ts);
28587 if (*ts ==
',') ts++;
28591 return PyErr_Format(PyExc_ValueError,
"Expected %d dimension(s), got %d",
28592 ctx->head->field->type->ndim, i);
28594 PyErr_SetString(PyExc_ValueError,
28595 "Unexpected end of format string, expected ')'");
28598 ctx->is_valid_array = 1;
28599 ctx->new_count = 1;
28603 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx,
const char* ts) {
28608 if (ctx->enc_type != 0 && ctx->head == NULL) {
28609 __Pyx_BufFmt_RaiseExpected(ctx);
28612 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
28613 if (ctx->head != NULL) {
28614 __Pyx_BufFmt_RaiseExpected(ctx);
28624 if (!__Pyx_Is_Little_Endian()) {
28625 PyErr_SetString(PyExc_ValueError,
"Little-endian buffer not supported on big-endian compiler");
28628 ctx->new_packmode =
'=';
28633 if (__Pyx_Is_Little_Endian()) {
28634 PyErr_SetString(PyExc_ValueError,
"Big-endian buffer not supported on little-endian compiler");
28637 ctx->new_packmode =
'=';
28643 ctx->new_packmode = *ts++;
28647 const char* ts_after_sub;
28648 size_t i, struct_count = ctx->new_count;
28649 size_t struct_alignment = ctx->struct_alignment;
28650 ctx->new_count = 1;
28653 PyErr_SetString(PyExc_ValueError,
"Buffer acquisition: Expected '{' after 'T'");
28656 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
28658 ctx->enc_count = 0;
28659 ctx->struct_alignment = 0;
28662 for (i = 0; i != struct_count; ++i) {
28663 ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
28664 if (!ts_after_sub)
return NULL;
28667 if (struct_alignment) ctx->struct_alignment = struct_alignment;
28672 size_t alignment = ctx->struct_alignment;
28674 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
28676 if (alignment && ctx->fmt_offset % alignment) {
28677 ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
28682 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
28683 ctx->fmt_offset += ctx->new_count;
28684 ctx->new_count = 1;
28685 ctx->enc_count = 0;
28687 ctx->enc_packmode = ctx->new_packmode;
28693 if (*ts !=
'f' && *ts !=
'd' && *ts !=
'g') {
28694 __Pyx_BufFmt_RaiseUnexpectedChar(
'Z');
28697 CYTHON_FALLTHROUGH;
28698 case '?':
case 'c':
case 'b':
case 'B':
case 'h':
case 'H':
case 'i':
case 'I':
28699 case 'l':
case 'L':
case 'q':
case 'Q':
28700 case 'f':
case 'd':
case 'g':
28701 case 'O':
case 'p':
28702 if ((ctx->enc_type == *ts) && (got_Z == ctx->is_complex) &&
28703 (ctx->enc_packmode == ctx->new_packmode) && (!ctx->is_valid_array)) {
28704 ctx->enc_count += ctx->new_count;
28705 ctx->new_count = 1;
28710 CYTHON_FALLTHROUGH;
28712 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
28713 ctx->enc_count = ctx->new_count;
28714 ctx->enc_packmode = ctx->new_packmode;
28715 ctx->enc_type = *ts;
28716 ctx->is_complex = got_Z;
28718 ctx->new_count = 1;
28723 while(*ts !=
':') ++ts;
28727 if (!__pyx_buffmt_parse_array(ctx, &ts))
return NULL;
28731 int number = __Pyx_BufFmt_ExpectNumber(&ts);
28732 if (
number == -1)
return NULL;
28733 ctx->new_count = (size_t)
number;
28741 __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b)
28748 if (a->size != b->size || a->typegroup != b->typegroup ||
28749 a->is_unsigned != b->is_unsigned || a->ndim != b->ndim) {
28750 if (a->typegroup ==
'H' || b->typegroup ==
'H') {
28751 return a->size == b->size;
28757 for (i = 0; i < a->ndim; i++)
28758 if (a->arraysize[i] != b->arraysize[i])
28761 if (a->typegroup ==
'S') {
28762 if (a->flags != b->flags)
28764 if (a->fields || b->fields) {
28765 if (!(a->fields && b->fields))
28767 for (i = 0; a->fields[i].type && b->fields[i].type; i++) {
28768 __Pyx_StructField *field_a = a->fields + i;
28769 __Pyx_StructField *field_b = b->fields + i;
28770 if (field_a->offset != field_b->offset ||
28771 !__pyx_typeinfo_cmp(field_a->type, field_b->type))
28774 return !a->fields[i].type && !b->fields[i].type;
28782 __pyx_check_strides(Py_buffer *buf,
int dim,
int ndim,
int spec)
28784 if (buf->shape[dim] <= 1)
28786 if (buf->strides) {
28787 if (spec & __Pyx_MEMVIEW_CONTIG) {
28788 if (spec & (__Pyx_MEMVIEW_PTR|__Pyx_MEMVIEW_FULL)) {
28789 if (unlikely(buf->strides[dim] !=
sizeof(
void *))) {
28790 PyErr_Format(PyExc_ValueError,
28791 "Buffer is not indirectly contiguous "
28792 "in dimension %d.", dim);
28795 }
else if (unlikely(buf->strides[dim] != buf->itemsize)) {
28796 PyErr_SetString(PyExc_ValueError,
28797 "Buffer and memoryview are not contiguous "
28798 "in the same dimension.");
28802 if (spec & __Pyx_MEMVIEW_FOLLOW) {
28803 Py_ssize_t stride = buf->strides[dim];
28806 if (unlikely(stride < buf->itemsize)) {
28807 PyErr_SetString(PyExc_ValueError,
28808 "Buffer and memoryview are not contiguous "
28809 "in the same dimension.");
28814 if (unlikely(spec & __Pyx_MEMVIEW_CONTIG && dim != ndim - 1)) {
28815 PyErr_Format(PyExc_ValueError,
28816 "C-contiguous buffer is not contiguous in "
28817 "dimension %d", dim);
28819 }
else if (unlikely(spec & (__Pyx_MEMVIEW_PTR))) {
28820 PyErr_Format(PyExc_ValueError,
28821 "C-contiguous buffer is not indirect in "
28822 "dimension %d", dim);
28824 }
else if (unlikely(buf->suboffsets)) {
28825 PyErr_SetString(PyExc_ValueError,
28826 "Buffer exposes suboffsets but no strides");
28835 __pyx_check_suboffsets(Py_buffer *buf,
int dim, CYTHON_UNUSED
int ndim,
int spec)
28837 if (spec & __Pyx_MEMVIEW_DIRECT) {
28838 if (unlikely(buf->suboffsets && buf->suboffsets[dim] >= 0)) {
28839 PyErr_Format(PyExc_ValueError,
28840 "Buffer not compatible with direct access "
28841 "in dimension %d.", dim);
28845 if (spec & __Pyx_MEMVIEW_PTR) {
28846 if (unlikely(!buf->suboffsets || (buf->suboffsets[dim] < 0))) {
28847 PyErr_Format(PyExc_ValueError,
28848 "Buffer is not indirectly accessible "
28849 "in dimension %d.", dim);
28858 __pyx_verify_contig(Py_buffer *buf,
int ndim,
int c_or_f_flag)
28861 if (c_or_f_flag & __Pyx_IS_F_CONTIG) {
28862 Py_ssize_t stride = 1;
28863 for (i = 0; i < ndim; i++) {
28864 if (unlikely(stride * buf->itemsize != buf->strides[i] && buf->shape[i] > 1)) {
28865 PyErr_SetString(PyExc_ValueError,
28866 "Buffer not fortran contiguous.");
28869 stride = stride * buf->shape[i];
28871 }
else if (c_or_f_flag & __Pyx_IS_C_CONTIG) {
28872 Py_ssize_t stride = 1;
28873 for (i = ndim - 1; i >- 1; i--) {
28874 if (unlikely(stride * buf->itemsize != buf->strides[i] && buf->shape[i] > 1)) {
28875 PyErr_SetString(PyExc_ValueError,
28876 "Buffer not C contiguous.");
28879 stride = stride * buf->shape[i];
28886 static int __Pyx_ValidateAndInit_memviewslice(
28891 __Pyx_TypeInfo *dtype,
28892 __Pyx_BufFmt_StackElem stack[],
28893 __Pyx_memviewslice *memviewslice,
28894 PyObject *original_obj)
28896 struct __pyx_memoryview_obj *memview, *new_memview;
28897 __Pyx_RefNannyDeclarations
28899 int i, spec = 0, retval = -1;
28900 __Pyx_BufFmt_Context ctx;
28901 int from_memoryview = __pyx_memoryview_check(original_obj);
28902 __Pyx_RefNannySetupContext(
"ValidateAndInit_memviewslice", 0);
28903 if (from_memoryview && __pyx_typeinfo_cmp(dtype, ((
struct __pyx_memoryview_obj *)
28904 original_obj)->typeinfo)) {
28905 memview = (
struct __pyx_memoryview_obj *) original_obj;
28906 new_memview = NULL;
28908 memview = (
struct __pyx_memoryview_obj *) __pyx_memoryview_new(
28909 original_obj, buf_flags, 0, dtype);
28910 new_memview = memview;
28911 if (unlikely(!memview))
28914 buf = &memview->view;
28915 if (unlikely(buf->ndim != ndim)) {
28916 PyErr_Format(PyExc_ValueError,
28917 "Buffer has wrong number of dimensions (expected %d, got %d)",
28922 __Pyx_BufFmt_Init(&ctx, stack, dtype);
28923 if (unlikely(!__Pyx_BufFmt_CheckString(&ctx, buf->format)))
goto fail;
28925 if (unlikely((
unsigned) buf->itemsize != dtype->size)) {
28926 PyErr_Format(PyExc_ValueError,
28927 "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T
"u byte%s) "
28928 "does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T
"u byte%s)",
28930 (buf->itemsize > 1) ?
"s" :
"",
28933 (dtype->size > 1) ?
"s" :
"");
28936 if (buf->len > 0) {
28937 for (i = 0; i < ndim; i++) {
28938 spec = axes_specs[i];
28939 if (unlikely(!__pyx_check_strides(buf, i, ndim, spec)))
28941 if (unlikely(!__pyx_check_suboffsets(buf, i, ndim, spec)))
28944 if (unlikely(buf->strides && !__pyx_verify_contig(buf, ndim, c_or_f_flag)))
28947 if (unlikely(__Pyx_init_memviewslice(memview, ndim, memviewslice,
28948 new_memview != NULL) == -1)) {
28954 Py_XDECREF(new_memview);
28957 __Pyx_RefNannyFinishContext();
28962 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_double(PyObject *obj,
int writable_flag) {
28963 __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
28964 __Pyx_BufFmt_StackElem stack[1];
28965 int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
28967 if (obj == Py_None) {
28968 result.memview = (
struct __pyx_memoryview_obj *) Py_None;
28971 retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
28972 PyBUF_RECORDS_RO | writable_flag, 1,
28973 &__Pyx_TypeInfo_double, stack,
28975 if (unlikely(retcode == -1))
28979 result.memview = NULL;
28980 result.data = NULL;
28985 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_int(PyObject *obj,
int writable_flag) {
28986 __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
28987 __Pyx_BufFmt_StackElem stack[1];
28988 int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
28990 if (obj == Py_None) {
28991 result.memview = (
struct __pyx_memoryview_obj *) Py_None;
28994 retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
28995 PyBUF_RECORDS_RO | writable_flag, 1,
28996 &__Pyx_TypeInfo_int, stack,
28998 if (unlikely(retcode == -1))
29002 result.memview = NULL;
29003 result.data = NULL;
29008 static int __Pyx_check_binary_version(
void) {
29009 char ctversion[4], rtversion[4];
29010 PyOS_snprintf(ctversion, 4,
"%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
29011 PyOS_snprintf(rtversion, 4,
"%s", Py_GetVersion());
29012 if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
29014 PyOS_snprintf(message,
sizeof(message),
29015 "compiletime version %s of module '%.100s' "
29016 "does not match runtime version %s",
29017 ctversion, __Pyx_MODULE_NAME, rtversion);
29018 return PyErr_WarnEx(NULL, message, 1);
29024 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
29026 #if PY_MAJOR_VERSION < 3
29027 if (t->is_unicode) {
29028 *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
29029 }
else if (t->intern) {
29030 *t->p = PyString_InternFromString(t->s);
29032 *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
29035 if (t->is_unicode | t->is_str) {
29037 *t->p = PyUnicode_InternFromString(t->s);
29038 }
else if (t->encoding) {
29039 *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
29041 *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
29044 *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
29049 if (PyObject_Hash(*t->p) == -1)
29056 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char* c_str) {
29057 return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
29059 static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject* o) {
29061 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
29063 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
29064 #if !CYTHON_PEP393_ENABLED
29065 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
29067 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
29068 if (!defenc)
return NULL;
29069 defenc_c = PyBytes_AS_STRING(defenc);
29070 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
29072 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
29074 for (
c = defenc_c;
c < end;
c++) {
29075 if ((
unsigned char) (*
c) >= 128) {
29076 PyUnicode_AsASCIIString(o);
29082 *length = PyBytes_GET_SIZE(defenc);
29086 static CYTHON_INLINE
const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
29087 if (unlikely(__Pyx_PyUnicode_READY(o) == -1))
return NULL;
29088 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
29089 if (likely(PyUnicode_IS_ASCII(o))) {
29090 *length = PyUnicode_GET_LENGTH(o);
29091 return PyUnicode_AsUTF8(o);
29093 PyUnicode_AsASCIIString(o);
29097 return PyUnicode_AsUTF8AndSize(o, length);
29102 static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
29103 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
29105 #
if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
29106 __Pyx_sys_getdefaultencoding_not_ascii &&
29108 PyUnicode_Check(o)) {
29109 return __Pyx_PyUnicode_AsStringAndSize(o, length);
29112 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
29113 if (PyByteArray_Check(o)) {
29114 *length = PyByteArray_GET_SIZE(o);
29115 return PyByteArray_AS_STRING(o);
29120 int r = PyBytes_AsStringAndSize(o, &result, length);
29121 if (unlikely(
r < 0)) {
29128 static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject* x) {
29129 int is_true = x == Py_True;
29130 if (is_true | (x == Py_False) | (x == Py_None))
return is_true;
29131 else return PyObject_IsTrue(x);
29133 static CYTHON_INLINE
int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
29135 if (unlikely(!x))
return -1;
29136 retval = __Pyx_PyObject_IsTrue(x);
29140 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result,
const char* type_name) {
29141 #if PY_MAJOR_VERSION >= 3
29142 if (PyLong_Check(result)) {
29143 if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
29144 "__int__ returned non-int (type %.200s). "
29145 "The ability to return an instance of a strict subclass of int "
29146 "is deprecated, and may be removed in a future version of Python.",
29147 Py_TYPE(result)->tp_name)) {
29154 PyErr_Format(PyExc_TypeError,
29155 "__%.4s__ returned non-%.4s (type %.200s)",
29156 type_name, type_name, Py_TYPE(result)->tp_name);
29160 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
29161 #if CYTHON_USE_TYPE_SLOTS
29162 PyNumberMethods *m;
29164 const char *name = NULL;
29165 PyObject *res = NULL;
29166 #if PY_MAJOR_VERSION < 3
29167 if (likely(PyInt_Check(x) || PyLong_Check(x)))
29169 if (likely(PyLong_Check(x)))
29171 return __Pyx_NewRef(x);
29172 #if CYTHON_USE_TYPE_SLOTS
29173 m = Py_TYPE(x)->tp_as_number;
29174 #if PY_MAJOR_VERSION < 3
29175 if (m && m->nb_int) {
29177 res = m->nb_int(x);
29179 else if (m && m->nb_long) {
29181 res = m->nb_long(x);
29184 if (likely(m && m->nb_int)) {
29186 res = m->nb_int(x);
29190 if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
29191 res = PyNumber_Int(x);
29195 #if PY_MAJOR_VERSION < 3
29196 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
29198 if (unlikely(!PyLong_CheckExact(res))) {
29200 return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
29203 else if (!PyErr_Occurred()) {
29204 PyErr_SetString(PyExc_TypeError,
29205 "an integer is required");
29209 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
29212 #if PY_MAJOR_VERSION < 3
29213 if (likely(PyInt_CheckExact(b))) {
29214 if (
sizeof(Py_ssize_t) >=
sizeof(
long))
29215 return PyInt_AS_LONG(b);
29217 return PyInt_AsSsize_t(b);
29220 if (likely(PyLong_CheckExact(b))) {
29221 #if CYTHON_USE_PYLONG_INTERNALS
29222 const digit* digits = ((PyLongObject*)b)->ob_digit;
29223 const Py_ssize_t size = Py_SIZE(b);
29224 if (likely(__Pyx_sst_abs(size) <= 1)) {
29225 ival = likely(size) ? digits[0] : 0;
29226 if (size == -1) ival = -ival;
29231 if (8 *
sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
29232 return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
29236 if (8 *
sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
29237 return -(Py_ssize_t) (((((
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
29241 if (8 *
sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
29242 return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
29246 if (8 *
sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
29247 return -(Py_ssize_t) (((((((
size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
29251 if (8 *
sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
29252 return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (
size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
29256 if (8 *
sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
29257 return -(Py_ssize_t) (((((((((
size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
29263 return PyLong_AsSsize_t(b);
29265 x = PyNumber_Index(b);
29267 ival = PyInt_AsSsize_t(x);
29271 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(
long b) {
29272 return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
29274 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(
size_t ival) {
29275 return PyInt_FromSize_t(ival);